Python 3.5版解决方案我是Repl.it的工程师,这是我们平台的限制.我们目前不允许传出网络请求.I'm trying lxml requests on Replit and I don't understand why it isn't working. The program doesn't stop running until the max retries, where I get this error:my code is quite straightforward:from lxml import htmlimport requestsurl = 'http://www.presidency.ucsb.edu/ws/index.php?pid=29400.html'r = requests.get(url)tree = html.fromstring(r.content)text = tree.xpath('//span[@class="displaytext"]/text()')print(text)How can I get this to run? I'm trying to get the content of that website, located in the "displaytext" span class. I've been using this Python guide for reference.Python version 3.5 解决方案 I'm an engineer at Repl.it and this is a limitation with our platform. We don't currently allow outgoing network requests. 这篇关于lxml在repl.it上的请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-23 21:08