一、介绍

    本例子用Selenium +phantomjs爬取栏目(http://tv.cctv.com/lm/)的信息

 

   

  二、网站信息

    [Python爬虫] 之三十:Selenium +phantomjs 利用 pyquery抓取栏目

 

    [Python爬虫] 之三十:Selenium +phantomjs 利用 pyquery抓取栏目

    [Python爬虫] 之三十:Selenium +phantomjs 利用 pyquery抓取栏目

    [Python爬虫] 之三十:Selenium +phantomjs 利用 pyquery抓取栏目

 

 

 

 

 

  

  三、数据抓取

    首先抓取所有要抓取网页链接,共39页,保存到数据库里面

    

    def getUrls(self):
        urls = []
        urls.append('http://tv.cctv.com/lm/')
        for index in range(2,40):
            urls.append("javascript:window.scroll(0,145);DataInteraction({0});showPageTitle_fenyei2('ELMT1413526954890942',{0});".format(index))
        self.db.SaveCCTVColumnUrls(urls,'0')
View Code

相关文章:

  • 2021-11-08
  • 2021-07-30
  • 2021-09-25
  • 2021-12-01
  • 2021-08-28
  • 2021-08-19
  • 2022-02-13
  • 2021-10-24
猜你喜欢
  • 2021-06-23
  • 2021-08-04
  • 2021-07-19
  • 2021-11-11
  • 2022-03-07
  • 2021-07-01
  • 2021-12-02
相关资源
相似解决方案