Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/307.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 在中文中通过URL浏览维基百科_Python_Url_Wikipedia_Scrape - Fatal编程技术网

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。。。。。。