我正在尝试从Microsoft更新目录网页获取更新二进制文件的下载URL。下载按钮将我带到一个新窗口,在那里我有目标二进制URL。在
如何通过解析目录网页获取二进制URL。在
我试过以下方法
import urllib.request
def main():
url = 'https://catalog.update.microsoft.com/v7/site/Search.aspx?q=KB3205400'
offlinePage = 'catalog.html'
print(url)
sourceWebPage(url, offlinePage)
def sourceWebPage(url, offlinePage):
request=urllib.request.Request(url,None,headers)
response = urllib.request.urlopen(request)
data = response.read()
with open(offlinePage, 'wb') as f:
f.write(data)
if __name__ == '__main__':
main()
但是保存的HTML源文件没有指向目标二进制URL的任何链接。在
下载弹出窗口由JavaScript生成,不能使用}来处理JavaScript。我建议你用硒。。在
requests
或{相关问题 更多 >
编程相关推荐