|
源代码:
import requests
from bs4 import BeautifulSoup
url="https://fs.lianjia.com/zufang/"
r=requests.get(url)
print(r)
print(r.text)
s=BeautifulSoup(r.text)
print(s,"html.parser")
s.find_all("div",class_="")
错误:
Warning (from warnings module):
File "C:\Users\Administrator\Desktop\python\11.21 01.py", line 7
s=BeautifulSoup(r.text)
GuessedAtParserWarning: No parser was explicitly specified, so I'm using the best available HTML parser for this system ("html.parser"). This usually isn't a problem, but if you run this code on another system, or in a different virtual environment, it may use a different parser and behave differently.
The code that caused this warning is on line 7 of the file C:\Users\Administrator\Desktop\python\11.21 01.py. To get rid of this warning, pass the additional argument 'features="html.parser"' to the BeautifulSoup c**tructor.
|
|