Python 在中文中通过URL浏览维基百科
那里 我正试着从维基百科上刮表,就像Python 在中文中通过URL浏览维基百科,python,url,wikipedia,scrape,Python,Url,Wikipedia,Scrape,那里 我正试着从维基百科上刮表,就像 ”https://zh.wikipedia.org/wiki/北京市" 或 ”https://zh.wikipedia.org/wiki/%E5%8C%97%E4%BA%AC%E5%B8%82“ 我的代码: word = "北京市" newword =urllib.parse.quote(word) URL = "https://zh.wikipedia.org/wiki/" + newword df = urllib.request.urlopen(URL
”https://zh.wikipedia.org/wiki/北京市"代码>
或
”https://zh.wikipedia.org/wiki/%E5%8C%97%E4%BA%AC%E5%B8%82“
我的代码:
word = "北京市"
newword =urllib.parse.quote(word)
URL = "https://zh.wikipedia.org/wiki/" + newword
df = urllib.request.urlopen(URL).read()
(or df = pd.read_html(URL))`
但它向我展示了urllib.error.urleror:Python的可能副本:urleror:“穿过长城,我们可以到达世界的每一个角落”@jnylen,谢谢。@georgexsh。。。。。。