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)

 

 python爬虫之路——无头浏览器初识及简单例子

 

 

相关文章:

  • 2021-07-05
  • 2022-01-06
  • 2021-11-07
  • 2021-08-12
  • 2021-11-29
  • 2022-02-09
  • 2022-02-09
猜你喜欢
  • 2022-12-23
  • 2021-04-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-12
相关资源
相似解决方案