How can a scraped HTML be different from the source code?

前端 未结 2 1237
一个人的身影
一个人的身影 2020-12-21 15:19

I\'m scraping a list of restaurants from a website (with permission) and I have a problem. The html python scrapes from the website is different from the html in the source

2条回答
  •  滥情空心
    2020-12-21 15:31

    In a word, javascript. You're downloading the basic HTML page, but you're not a browser, and you're not downloading and running any of the javascript code that the browser would run. And many sites these days start with a very small HTML page, and use scripting to dynamically load and display additional data from the server.

提交回复
热议问题