urllib.urlopen无法使用页面ID打开网址

时间:2017-11-06 05:38:15

标签: python urllib urlopen

似乎urlopen在之后忽略了所有内容?。为网址https://apm.activecommunities.com/danvilleca/Activity_Search?Page=11https://apm.activecommunities.com/danvilleca/Activity_Search?Page=1返回了相同的对象。试图逃避问号但无济于事。非常感谢,如果有人可以分享见解

urllib.urlopen('https://apm.activecommunities.com/danvilleca/Activity_Search?Page=11').read()
urllib.urlopen('https://apm.activecommunities.com/danvilleca/Activity_Search?Page=1').read()

1 个答案:

答案 0 :(得分:0)

您可以尝试关注代码段并检查它是否有效。

url = 'https://apm.activecommunities.com/danvilleca/Activity_Search?Page=11'
response = urllib.Request(url)
info = urllib.urlopen(req).read()