py4e icon indicating copy to clipboard operation
py4e copied to clipboard

Updated spider.py: moved BeautifulSoup html.parser to fix "cannot retrieve or parse page" error

Open Amanda-P-bus opened this issue 9 months ago • 0 comments

Moved ' soup = BeautifulSoup(html, "html.parser") ' from line 92 to line 80.

I was getting parsing errors every time I attempted to run it. Moving it above the if statements in the try finally got it running smoothly. I saw many people online with the same issues/error attempting to run this code so they could follow along with the Page Rank worked example.

Hope this isn't too wordy, it's my very first pull request.

Amanda-P-bus avatar Apr 10 '25 21:04 Amanda-P-bus