Python脚本结合SELENIUM和PHOTOMJS工具模拟用户操作获取加载后的代码,并附带机票价格信息
发布时间
阅读量:
阅读量
#coding:utf8
AI写代码python
运行
from selenium import webdriver
import time
driver = webdriver.PhantomJS()
driver.get('http://www.ceair.com/flight2014/pvg-nay-171201_CNY.html')
time.sleep(1)
driver.save_screenshot('5.png')
# 定位到出发城市框
ele_fromcity = driver.find_element_by_xpath("/html/body/section[@id='main-area']/section[@class='flight-booking']/section[@class='booking-search clearfix']/div[@id='trip']/dl/dd[1]/span[@id='citySelect0']/input[@class='input city citySelect-text']")
全部评论 (0)
还没有任何评论哟~
