对付ajax ,配置selenium+phantonjs
生活随笔
收集整理的這篇文章主要介紹了
对付ajax ,配置selenium+phantonjs
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1、pip安裝selenium
2、
from selenium import webdriverimport time
driver = webdriver.PhantomJS(executable_path='C:\Program Files\Anaconda3\Scripts\phantomjs') #設置phantomjs的儲存路徑
driver.get("http://vacations.ctrip.com/bookingnext/Comment/Search?pkg=12661501&destEname=&districtID=0&country=0&urlCategory=grouptravel&PMPicture=https://dimg04.c-ctrip.com/images/300g0a00000055ksrCEB6.jpg&pageIndex=2&score=undefined&IsTourGroupProduct=0")
time.sleep(3)
print(driver.find_element_by_id('js_questionData').text)
driver.close()
?
轉載于:https://www.cnblogs.com/pythongo/p/6416858.html
總結
以上是生活随笔為你收集整理的对付ajax ,配置selenium+phantonjs的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 使用js如何获取treeview控件的当
- 下一篇: openstack--1--基础环境搭建