我正在编写一个程序,我需要像在计算机上一样从一个页面转到另一个页面。
在urllib上我转到一个页面并从该页面源获取一个网址然后我拿到该网址然后我去了那个但是我从网站上收到错误,说我来自错误的页面,因为urllib没有从一个页面开始转到另一个页面,它会打开一个新页面。 。 这是一些示例代码:
tree = self.opener.open('http://www.example.com').read()
#Beautiful soup parsing to get the new _url
new_page = self.opener.open('http://www.example/new_url.com').read()
print new_page #Output is error page
我如何编写它以便网站认为我来自上一页?
谢谢