Open mecrayavcin opened 2 years ago
Ehen i run it, it gives this error?
`c:\Users\Messi\Desktop\bot\IG-Bot-main\like_cmt_follow.py:18: DeprecationWarning: executable_path has been deprecated, please pass in a Service object browser = webdriver.Chrome(executable_path=ChromeDriverManager().install(), options=options)
DevTools listening on ws://127.0.0.1:56093/devtools/browser/9082e5e2-ee79-48de-b666-a885c610ca91 Traceback (most recent call last): File "c:\Users\Messi\Desktop\bot\IG-Bot-main\like_cmt_follow.py", line 84, in main() File "c:\Users\Messi\Desktop\bot\IG-Bot-main\like_cmt_follow.py", line 22, in main username_input = browser.find_element_by_css_selector("input[name='username']") AttributeError: 'WebDriver' object has no attribute 'find_element_by_css_selector' (bot) PS C:\Users\Messi\Desktop\bot>`
How can i fix this? Thanks
----------Try This One-------------
from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.chrome.service import Service from webdriver_manager.chrome import ChromeDriverManager
options = Options() options.add_argument("--lang=en") browser = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=options) browser.get("https://www.instagram.com")
Hi, after applying your edit, I get an error: username_input = browser.find_element_by_css_selector("input[name='username']") AttributeError: 'WebDriver' object has no attribute 'find_element_by_css_selector'
will you help an amateur? : D
I solved the problem The problem is in the wrong version of selenium. This should help : pip install selenium == 4.2.0 --force-reinstall
pip install selenium == 4.2.0 --force-reinstall
@Brodazen Thank you you solved my problem
Latest Error in Nov 2022 - COuld You please help?
Type your comment: Looks Great!
C:\Users\dell\Desktop\IG-Bot-main\IG-Bot-main\like_cmt_follow.py:47: DeprecationWarning: find_element_by_xpath is deprecated. Please use find_element(by=By.XPATH, value=xpath) instead
like_post = browser.find_element_by_xpath("//section[@class= '_aamu _aat0']/span[1]/button")
Traceback (most recent call last):
File "C:\Users\dell\Desktop\IG-Bot-main\IG-Bot-main\like_cmt_follow.py", line 84, in
Even after using above changes
[12164:14312:1124/015214.518:ERROR:util.cc(129)] Can't create base directory: C:\Program Files\Google\GoogleUpdater
C:\Users\dell\Desktop\IG-Bot-main\IG-Bot-main\like_cmt_follow.py:47: DeprecationWarning: find_element_by_xpath is deprecated. Please use find_element(by=By.XPATH, value=xpath) instead
like_post = browser.find_element_by_xpath("//section[@class= '_aamu _aat0']/span[1]/button")
Traceback (most recent call last):
File "C:\Users\dell\Desktop\IG-Bot-main\IG-Bot-main\like_cmt_follow.py", line 84, in
Ehen i run it, it gives this error?
`c:\Users\Messi\Desktop\bot\IG-Bot-main\like_cmt_follow.py:18: DeprecationWarning: executable_path has been deprecated, please pass in a Service object browser = webdriver.Chrome(executable_path=ChromeDriverManager().install(), options=options)
DevTools listening on ws://127.0.0.1:56093/devtools/browser/9082e5e2-ee79-48de-b666-a885c610ca91 Traceback (most recent call last): File "c:\Users\Messi\Desktop\bot\IG-Bot-main\like_cmt_follow.py", line 84, in
main()
File "c:\Users\Messi\Desktop\bot\IG-Bot-main\like_cmt_follow.py", line 22, in main
username_input = browser.find_element_by_css_selector("input[name='username']")
AttributeError: 'WebDriver' object has no attribute 'find_element_by_css_selector'
(bot) PS C:\Users\Messi\Desktop\bot>`
How can i fix this? Thanks