[英]Difficulty reading Multiple Tweet JSON file in python(attaching the link of the file)
[英]Reading text from file and attaching to link in selenium with python
我正在嘗試從文件中讀取文本行並將它們附加到鏈接的末尾並執行一些操作,然后讀取下一行並重復相同的過程。
這是我到目前為止所擁有的,並感謝任何和所有幫助!
url = "https://www.instagram.com/"
f = open("names.txt")
text1 = [text.strip() for text in f.readlines()]
for text in text1:
browser.get(url(text1))
print(url)
f.close
我收到的錯誤 -
“str”對象不可調用
您需要先連接字符串,然后將其發送到 browser.get()
你能檢查一下這個代碼嗎
url = "https://www.instagram.com/"
f = open("names.txt")
text1 = f.readlines()
for text in text1:
driver.get('{}{}'.format(url, text.strip()))
print('{}{}'.format(url, text.strip()))
f.close()
我相信您的 txt 文件包含一些 Instagram 用戶名。 如果我錯了,請糾正我。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.