【发布时间】:2022-01-21 09:41:19
【问题描述】:
我正在做一个与航班价格相关的项目,当我在网上搜索部门时遇到错误。 网址是https://flight.yatra.com/air-search-ui/dom2/trigger?ADT=1&CHD=0&INF=0&class=Economy&destination=BOM&destinationCountry=IN&flexi=0&flight_depart_date=22%2F01%2F2022&hb=0&noOfSegments=1&origin=DEL&originCountry=IN&type=O&unique=254010891105&viewName=normal
我的代码是:
dept_time=driver.find_elements("//div[@class='i-b col-4 no-wrap text-right dtime col-3']")
dept= []
for i in dept_time:
a = i.get_attribute('innerText')
print(a)
dept.append(a)
print(dept)
我也试过"//div[@class='i-b pr']
但我收到了同样的错误
【问题讨论】:
-
它是刮、刮、刮——废是完全不同的东西。
标签: python selenium selenium-webdriver xpath