Home > other >  Python code, same runs show different results
Python code, same runs show different results

Time:10-03

The import requests
The from bs4 import BeautifulSoup
Url="http://product.dangdang.com/23950158.html"
Headers={' the user-agent ':' Mozilla/5.0 (Windows NT 10.0; Win64. X64; The rv: 71.0) Gecko/20100101 Firefox/71.0 '}
R=requests. Get (url=url, headers=headers, timeout=50)
Print (r.t ext)

Code is very simple, that's right, sometimes run out like this:

That, of course, is to want, but sometimes it is like this:

Have a great god tell me what to do? How the response is stable in the first picture?
Scrapy next to do?

CodePudding user response:

If it is a dynamic web pages not render advice to use scrapy - splash

CodePudding user response:

reference 1/f, ice all over the sky the wind response:
if it is a dynamic web pages not render advice to use scrapy - splash

Can go into more detail about it?
Have the books recommend related tutorials or under?

  • Related