fbcrawl icon indicating copy to clipboard operation
fbcrawl copied to clipboard

IndexError: list index out of range in comments.py line63

Open chrixtal opened this issue 4 years ago • 1 comments

when I trying to crawling my site, it occurs error:

  File ".\comments.py", line 63, in parse_page
    temp_post = response.urljoin(post[0])
IndexError: list index out of range

the above line is: post = post.xpath(".//a[contains(@href,'footer')]/@href").extract()

I trying to open source of my target site page, It have 13 'footer', and I check the post[], it len(post[]) is 0.

how come?, is anyone can give me a suggestion?

chrixtal avatar Jul 26 '20 02:07 chrixtal

You're probably using "page" instead of "post", try changing that:

scrapy crawl comments -a email="[email protected]" -a password="pass" -a post="https://mbasic.facebook.com/story.php?story_fbid=1212323232" -o trump_comments.csv

slakat avatar Aug 13 '20 17:08 slakat