在python中读取网页时出错,但url在webrows上工作

2024-09-30 03:22:40 发布

您现在位置:Python中文网/ 问答频道 /正文

我可以从浏览器访问网页,但当以编程方式访问网页时,它不起作用

我试过用quote#u plus表示#k=#s

urlpage = 'https://www.dnp.gov.co/CONPES/documentos-conpes/Paginas/documentos-conpes.aspx#k=#s=11'
print(urlpage)

html = urlopen(urlpage)

Tags: https网页www编程方式浏览器plusquote
1条回答
网友
1楼 · 发布于 2024-09-30 03:22:40

在Python3.x中,使用webbrowser模块从程序中打开webbrowser中的Web链接:

import webbrowser
urlpage = "https://www.dnp.gov.co/CONPES/documentos-conpes/Paginas/documentos-conpes.aspx#k=#s=11"
html = webbrowser.open(urlpage)

相关问题 更多 >

    热门问题