Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 98351

Login on Instagram using python but it gives error, help pls

$
0
0

I have made a code where I try to login to my instagram account but it gives me many errors (If anyone knows how to fix them, tell me pls)

.The code:

import pdb
from selenium import webdriver

driver = webdriver.PhantomJS()
driver.get('https://www.instagram.com/accounts/login/')
dom = driver.find_element_by_xpath('//*')

pdb.set_trace()
username = dom.find_element_by_name('username')
password = dom.find_element_by_name('password')
login_button = dom.find_element_by_xpath('//*[@class="_qv64e _gexxb _4tgw8 _njrw0"]')

username.clear()
password.clear()
username.send_keys('your username')
password.send_keys('your password')

login_button.click()
driver.get('https://www.instagram.com/accounts/login')

if 'logged-in' in driver.page_source:
    print 'Logged in'

.The error:

Warning (from warnings module): File "C:\Users\Usuario\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\phantomjs\webdriver.py", line 49 warnings.warn('Selenium support for PhantomJS has been deprecated, please use headless ' UserWarning: Selenium support for PhantomJS has been deprecated, please use headless versions of Chrome or Firefox instead Traceback (most recent call last): File "C:\Users\Usuario\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\common\service.py", line 76, in start stdin=PIPE) File "C:\Users\Usuario\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 775, in init restore_signals, start_new_session) File "C:\Users\Usuario\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 1178, in _execute_child startupinfo) FileNotFoundError: [WinError 2] El sistema no puede encontrar el archivo especificado

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\Usuario\Desktop\Programaciones Python\Pruebas.py", line 4, in driver = webdriver.PhantomJS() File "C:\Users\Usuario\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\phantomjs\webdriver.py", line 56, in init self.service.start() File "C:\Users\Usuario\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\common\service.py", line 83, in start os.path.basename(self.path), self.start_error_message) selenium.common.exceptions.WebDriverException: Message: 'phantomjs' executable needs to be in PATH.


Viewing all articles
Browse latest Browse all 98351

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>