Tao*_*sof 3 python screen-scraping beautifulsoup web-scraping
我抓了以下页面:
http://www.nasa.gov/topics/earth/features/plains-tornadoes-20120417.html
但是在调用时遇到了Segmentation fault(core dumped):BeautifulSoup(page_html),其中page_html是来自请求库的内容.这是BeautifulSoup的错误吗?有没有办法解决这个问题?甚至像try一样的方法...除了帮助我运行我的代码.提前致谢.
代码如下:
import requests
from bs4 import BeautifulSoup
toy_url = 'http://www.nasa.gov/topics/earth/features/plains-tornadoes-20120417.html'
res = requests.get(toy_url,headers={"USER-Agent":"Firefox/12.0"})
page = res.content
soup = BeautifulSoup(page)
Run Code Online (Sandbox Code Playgroud)