Python Forum

Full Version: unexpected token < in json at position 0
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
from selenium import webdriver
import time
from selenium.webdriver.common.keys import Keys


username = 'xxxxxxxx'
password = 'xxxx'

url = 'https://betfury.io/'

driver = webdriver.Chrome('C:\chromedriver.exe')

driver.get(url)

time.sleep(10)
#log poga
driver.find_element_by_xpath('//*[@id="app"]/div[3]/div/div/nav/div[2]/div/button[1]').click()
time.sleep(10)

# Email input
driver.find_element_by_xpath('/html/body/div[1]/div[3]/div/div/div[1]/form/div[1]/div/input').send_keys(username)
#pass input
#/html/body/div[1]/div[3]/div/div/div[1]/form/div[2]/div/input
driver.find_element_by_xpath('/html/body/div[1]/div[3]/div/div/div[1]/form/div[2]/div/input').send_keys(password)

#press login button
loginbutton = driver.find_element_by_xpath('//*[@id="app"]/div[3]/div/div/div[1]/form/button')
loginbutton.click()
and i get a erorr like this - unexpected token < in json at position 0
i use python 3.9 code run into pycharm, use selenium webdriver - goglechromedriver
please help me out what i do wrong...

i whanted to auto login website...
Quote:and i get a erorr like this - unexpected token < in json at position 0
please show entire unaltered error message (traceback) in error tags.
There's a lot of useful information that helps discover the cause of the errors.
(Jul-05-2021, 02:13 AM)Larz60+ Wrote: [ -> ]
Quote:and i get a erorr like this - unexpected token < in json at position 0
please show entire unaltered error message (traceback) in error tags.
There's a lot of useful information that helps discover the cause of the errors.

this is only what i get...
This looks like a website error, and not coming from your code.
(Jul-09-2021, 11:11 PM)Larz60+ Wrote: [ -> ]This looks like a website error, and not coming from your code.
How can i goo around it? If i go from gogle chrome web brouser i can log in, when i go trought webdrive i cant login. Theare are poseoble go araund somehow, and get in the web site? If i use webbrouser in code instead webdrive, i cant use findelementbyxpath and ext comonds ... So i thinking if theare some posoble to get in... Maybe some one can help get in, i can pay a some litle $ for helping out me...
I'm not sure you can go around it.
Bring thr debugger up, and step through the program until the error pops up.
When i tried the site, a pop-up came up informing me that I was unable to use the app.
That may be what's causing the error.
At any rate, it's not python of selenium that's causing issuing the error.
stepping through with debugger will isolate the statement that starts the error condition.
If you don't know hoe to use the debugger, see your ide's documentation, or use print statements