0
は、これはこれは私が別のURLを試してみましたpowersehll
==============
Traceback (most recent call last):
File "crawlertest.py", line 9, in <module>
soup = beautifulsoup(request)
NameError: name 'beautifulsoup' is not defined
==============
からのエラー情報である私のコード powershellがなぜ私に名前の誤りを記録するのですか?
==============
import urllib2
from bs4 import BeautifulSoup
url = 'https://www.crummy.com/software'
user_agent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5)'
headers = {'User-Agent' : user_agent}
request = urllib2.Request(url,headers = headers)
response = urllib2.urlopen(request)
content = response.read()
soup = beautifulsoup(request)
print soup.body#get the body element
==============
'print soup.bdoy'を' print soup.body'に変更してください。 –