【发布时间】:2016-05-06 07:49:34
【问题描述】:
我正在尝试使用网络抓取来获取此链接上的停车价格,https://application.parkbytext.com/accountus/prepay.htm?locationCode=1127。这是我想要得到的那一天的 $2。我正在使用 python+selenium,但无法获得停车价格。下面是我正在使用的代码,但有时我达到了目标,但大多数时候我得到了错误
selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: {"method":"class name","selector":"gwt-RadioButton"}.
有人可以帮忙吗?提前致谢
def downtownparking(driver):
driver.get("https://application.parkbytext.com/accountus/prepay.htm?locationCode=1127")
try:
### driver.wait = WebDriverWait(driver, 16)
### driver.implicitly_wait(20)
cr = driver.find_element_by_class_name("gwt-RadioButton")
dayprice = cr.find_element_by_tag_name("label")
print (dayprice.text)
【问题讨论】:
标签: python selenium web web-scraping screen-scraping