python爬蟲之路——無頭瀏覽器初識及簡單例子


 

 

 

 

from selenium import webdriver
url='https://www.jianshu.com/p/a64529b4ccf3'
def get_info(url):
    include_title=[]
    driver=webdriver.PhantomJS()
    driver.get(url)
    driver.implicitly_wait(20)
    author=driver.find_element_by_xpath('/html/body/div[1]/div[1]/div[1]/div[1]/div/span/a').text
    print(author)
get_info(url)

 

 

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM