嗨,我不知道怎么摆脱这个。我试图用.strip(“',()”)删除这段代码,并从元组对象中创建一个字符串,但它仍然运行相同的错误。
indir = '/home/d/Desktop/civiv_hacking/Streetnames/dump/berlin.kauperts.de/Strassen'
for root, dirs, filenames in os.walk(indir):
for f in filenames:
x = urlparse.urljoin("https://berlin.kauperts.de/Strassen/", f+".html"),
print(f),
print(x),
for r in requests.get(x):'
print(x)给出('https://berlin.kauperts.de/Strassen/Igelsteig-12557-Berlin.html',)
但是,如果我执行:x1 = (str(x).strip("(),'")),
,则会https://berlin.kauperts.de/Strassen/Igelsteig-12557-Berlin.html
但我仍然总是得到同样的错误:
in get_adapter raise InvalidSchema("No connection adapters were found for '%s'" % url)
requests.exceptions.InvalidSchema: No connection adapters were found for '('https://berlin.kauperts.de/Strassen/Igelsteig-12557-Berlin.html',)'
有没有人知道如何解决这个问题? 非常感谢提前!