【发布时间】:2019-07-13 20:27:40
【问题描述】:
使用命令:
cena_postov=driver.find_elements_by_xpath("//*[starts-with(@id, 'td_')]/td[11]/a[1]/span/span")
for spisok_cen in cena_postov:
print(spisok_cen.get_attribute('textContent'))
我得到一个文本列表。我想将其转换为数字使用
if int(spisok_cen.get_attribute('textContent'))<=10 and int(spisok_cen.get_attribute('textContent'))>=12000:
print('anything')
但是'这个符号让我很困扰。
我收到一个错误invalid literal for int() with base 10: ": 6'000
如何让python忽略这个字符?
【问题讨论】:
标签: python python-2.7 selenium selenium-webdriver selenium-chromedriver