所有人都相信您很好

txt_box = bot.find_element_by_xpath('/html/body/div[1]/section/div/div[2]/div/div/div[2]/div[2]/div/div[2]/div/div/div[2]/textarea')
txt_box.send_keys(f"Hey @{user}") # Customize your message
運行代碼時收到的錯誤:
txt_box = bot.find_element_by_xpath('//textarea[@placeholder="Message..."]')
Exception in thread Test 1:
Traceback (most recent call last):
File "C:\Users\veron.000\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1009, in _bootstrap_inner
self.run()
File "C:\Users\veron.000\AppData\Local\Programs\Python\Python310\lib\threading.py", line 946, in run
self._target(*self._args, **self._kwargs)
File "c:\Users\veron.000\Desktop\Eros\Instagram\Instgram Dm v1\Final\Multi_Dm.py", line 83, in test_instance
send_msg(usrnamee)
File "c:\Users\veron.000\Desktop\Eros\Instagram\Instgram Dm v1\Final\Multi_Dm.py", line 73, in send_msg
txt_box.send_keys(f"Hey @{user}, I'm Jordan from ARICCI’s Talent Recruitment in London.\nWe’re an upcoming sunglasses brand and we would love to see you in our new pieces!\n\nWould you be down for promoting us and earning FREE products, BIG commissions, and getting featured on our official Instagram page?\n\n?? DM us @ariccirecruiter to get started! Offer runs out in 48 hours. ?") # Customize your message
File "C:\Users\veron.000\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\webelement.py", line 540, in send_keys
self._execute(Command.SEND_KEYS_TO_ELEMENT,
File "C:\Users\veron.000\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\webelement.py", line 710, in _execute
return self._parent.execute(command, params)
File "C:\Users\veron.000\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 425, in execute
uj5u.com熱心網友回復:
完整的錯誤資訊顯示查找沒有問題textarea。
只有warning在下一個版本中您必須使用find_element(By.XPATH).
真正的問題使send_key(). 發送一些字符似乎有問題。
可能它發送有問題emoji- 所以嘗試不使用emoji.
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/482301.html
