如果我想先刮一个需要用密码登录的网站,怎样才能开始使用beautifulsoup4库用python抓它?以下是我对不需要登录的网站所做的工作.
from bs4 import BeautifulSoup
import urllib2
url = urllib2.urlopen("http://www.python.org")
content = url.read()
soup = BeautifulSoup(content)
Run Code Online (Sandbox Code Playgroud)
如何更改代码以适应登录?假设我要抓的网站是一个需要登录的论坛.一个例子是http://forum.arduino.cc/index.php