G G*_*cia 2 python screen-scraping urllib2
我正在尝试抓一个页面(我的路由器的管理页面),但该设备似乎正在为urllib2提供与我的浏览器不同的页面.以前有人发现过这个吗?我怎么能绕过它呢?
这个我正在使用的代码:
>>> from BeautifulSoup import BeautifulSoup
>>> import urllib2
>>> page = urllib2.urlopen("http://192.168.1.254/index.cgi?active_page=9133&active_page_str=page_bt_home&req_mode=0&mimic_button_field=btn_tab_goto:+9133..&request_id=36590071&button_value=9133")
>>> soup = BeautifulSoup(page)
>>> soup.prettify()
Run Code Online (Sandbox Code Playgroud)
(通过降价删除html输出)
归档时间: |
|
查看次数: |
2439 次 |
最近记录: |