使用命令:
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忽略这个字符
可以使用
replace
方法删除不必要的'
:您还可以用
locale
here找到解决方案相关问题 更多 >
编程相关推荐