import requests
class HtmlDownloader(object):
def download(self,url):
if url is None:
return None
r = requests.get(url)
if r.status_code != 200:
return None
return r.text
class HtmlDownloader(object):
def download(self,url):
if url is None:
return None
r = requests.get(url)
if r.status_code != 200:
return None
return r.text
2016-06-07
用DOS命令出现这种情况,求解
Traceback (most recent call last):
File "spider_main.py", line 3, in <module>
from baike_spider import html_parser
File "C:\Python34\baike_spider\html_parser.py", line 1, in <module>
from bs4 import BeautifulSoup
ImportError: No module named 'bs4'
Traceback (most recent call last):
File "spider_main.py", line 3, in <module>
from baike_spider import html_parser
File "C:\Python34\baike_spider\html_parser.py", line 1, in <module>
from bs4 import BeautifulSoup
ImportError: No module named 'bs4'
2016-06-06