python - Want to get video times from page -


i doing coursera course work. need log times of each of videos watching. found scrapy , excited. logged course , have finished watching videos section.

i tried opening scrapy shell: scrapy shell "https://class.coursera.org/regmods-030/lecture"

then opened page in new tab firebug try , find html tags had times. found: <a blah > title (1:23) </a> , <div class="hidden"> title (1:23).

in shell after opened url, tried response.xpath('//div[@class="hidden"]') , got nothing.

here spider code:

import scrapy  class dataspider(scrapy.spider): name = "data" allowed_domains = ["coursera.org"] start_urls = [    "https://class.coursera.org/regmods-030/lecture" ]  def parse(self, response):     sel in response.xpath('//ul/li'):         item = dataitem()         item['title'] = sel.xpath('a/text()').extract()         item['link'] = sel.xpath('a/@href').extract()         item['desc'] = sel.xpath('text()').extract()         yield item` 

i realize above code tutorial, cannot find how search div.

ultimately, want do, able scrape times of videos csv file, can add them up. can submit info boss.

where going wrong?


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -