Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

Search not working in docker #80

Open
Lexxior opened this issue Apr 22, 2023 · 3 comments
Open

Search not working in docker #80

Lexxior opened this issue Apr 22, 2023 · 3 comments

Comments

@Lexxior
Copy link

Lexxior commented Apr 22, 2023

I got the docker container to start on my headless VPS, but the search doesn't work
this is the error log I get

Traceback (most recent call last):
  File "/app/main.py", line 1169, in update_searches
    PC = driver.find_element(By.XPATH, value='//*[@id="userPointsBreakdown"]/div                                                                                                             /div[2]/div/div[1]/div/div[2]/mee-rewards-user-points-details/div/div/div/div/p[                                                                                                             2]').text.replace(" ", "").split("/")
  File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdri                                                                                                             ver.py", line 830, in find_element
    return self.execute(Command.FIND_ELEMENT, {"using": by, "value": value})["va                                                                                                             lue"]
  File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdri                                                                                                             ver.py", line 440, in execute
    self.error_handler.check_response(response)
  File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/errorh                                                                                                             andler.py", line 245, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Una                                                                                                             ble to locate element: {"method":"xpath","selector":"//*[@id="userPointsBreakdow                                                                                                             n"]/div/div[2]/div/div[1]/div/div[2]/mee-rewards-user-points-details/div/div/div                                                                                                             /div/p[2]"}
  (Session info: chrome=109.0.5414.119)
Stacktrace:
#0 0x556a21895303 <unknown>
#1 0x556a21669d37 <unknown>
#2 0x556a216a65b2 <unknown>
#3 0x556a216a66c1 <unknown>
#4 0x556a216e0b34 <unknown>
#5 0x556a216c69ad <unknown>
#6 0x556a216de88c <unknown>
#7 0x556a216c6753 <unknown>
#8 0x556a21699a14 <unknown>
#9 0x556a2169ab7e <unknown>
#10 0x556a218e432e <unknown>
#11 0x556a218e7c0e <unknown>
#12 0x556a218ca610 <unknown>
#13 0x556a218e8c23 <unknown>
#14 0x556a218bc545 <unknown>
#15 0x556a219096a8 <unknown>
#16 0x556a21909836 <unknown>
#17 0x556a21924d13 <unknown>
#18 0x7f6bd20f6b43 <unknown>



Message: no such element: Unable to locate element: {"method":"xpath","selector"                                                                                                             :"//*[@id="daily-sets"]/mee-card-group[1]/div/mee-card[1]/div/card-content/mee-r                                                                                                             ewards-daily-set-item-content/div/a/mee-rewards-points/div/div/span[1]"}
  (Session info: chrome=109.0.5414.119)
Stacktrace:
#0 0x556a21895303 <unknown>
#1 0x556a21669d37 <unknown>
#2 0x556a216a65b2 <unknown>
#3 0x556a216a66c1 <unknown>
#4 0x556a216e0b34 <unknown>
#5 0x556a216c69ad <unknown>
#6 0x556a216de88c <unknown>
#7 0x556a216c6753 <unknown>
#8 0x556a21699a14 <unknown>
#9 0x556a2169ab7e <unknown>
#10 0x556a218e432e <unknown>
#11 0x556a218e7c0e <unknown>
#12 0x556a218ca610 <unknown>
#13 0x556a218e8c23 <unknown>
#14 0x556a218bc545 <unknown>
#15 0x556a219096a8 <unknown>
#16 0x556a21909836 <unknown>
#17 0x556a21924d13 <unknown>
#18 0x7f6bd20f6b43 <unknown>

Message: no such element: Unable to locate element: {"method":"xpath","selector"                                                                                                             :"//*[@id="daily-sets"]/mee-card-group[1]/div/mee-card[3]/div/card-content/mee-r                                                                                                             ewards-daily-set-item-content/div/a/mee-rewards-points/div/div/span[1]"}
  (Session info: chrome=109.0.5414.119)
Stacktrace:
#0 0x556a21895303 <unknown>
#1 0x556a21669d37 <unknown>
#2 0x556a216a65b2 <unknown>
#3 0x556a216a66c1 <unknown>
#4 0x556a216e0b34 <unknown>
#5 0x556a216c69ad <unknown>
#6 0x556a216de88c <unknown>
#7 0x556a216c6753 <unknown>
#8 0x556a21699a14 <unknown>
#9 0x556a2169ab7e <unknown>
#10 0x556a218e432e <unknown>
#11 0x556a218e7c0e <unknown>
#12 0x556a218ca610 <unknown>
#13 0x556a218e8c23 <unknown>
#14 0x556a218bc545 <unknown>
#15 0x556a219096a8 <unknown>
#16 0x556a21909836 <unknown>
#17 0x556a21924d13 <unknown>
#18 0x7f6bd20f6b43 <unknown>

Message: no such element: Unable to locate element: {"method":"xpath","selector"                                                                                                             :"//*[@id="daily-sets"]/mee-card-group[1]/div/mee-card[2]/div/card-content/mee-r                                                                                                             ewards-daily-set-item-content/div/a/mee-rewards-points/div/div/span[1]"}
  (Session info: chrome=109.0.5414.119)
Stacktrace:
#0 0x556a21895303 <unknown>
#1 0x556a21669d37 <unknown>
#2 0x556a216a65b2 <unknown>
#3 0x556a216a66c1 <unknown>
#4 0x556a216e0b34 <unknown>
#5 0x556a216c69ad <unknown>
#6 0x556a216de88c <unknown>
#7 0x556a216c6753 <unknown>
#8 0x556a21699a14 <unknown>
#9 0x556a2169ab7e <unknown>
#10 0x556a218e432e <unknown>
#11 0x556a218e7c0e <unknown>
#12 0x556a218ca610 <unknown>
#13 0x556a218e8c23 <unknown>
#14 0x556a218bc545 <unknown>
#15 0x556a219096a8 <unknown>
#16 0x556a21909836 <unknown>
#17 0x556a21924d13 <unknown>
#18 0x7f6bd20f6b43 <unknown>

Traceback (most recent call last):
  File "/app/main.py", line 1066, in pc_search_helper
    pc_search(driver, EMAIL, PASSWORD, PC_SEARCHES)
  File "/app/main.py", line 1006, in pc_search
    driver.get(os.environ['URL'])
  File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py", line 449, in get
    self.execute(Command.GET, {"url": url})
  File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py", line 440, in execute
    self.error_handler.check_response(response)
  File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/errorhandler.py", line 245, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.InvalidArgumentException: Message: invalid argument
  (Session info: chrome=109.0.5414.119)
Stacktrace:
#0 0x556a21895303 <unknown>
#1 0x556a21669bbd <unknown>
#2 0x556a21654b89 <unknown>
#3 0x556a21652e5e <unknown>
#4 0x556a216532a4 <unknown>
#5 0x556a2166bc48 <unknown>
#6 0x556a216def15 <unknown>
#7 0x556a216c6982 <unknown>
#8 0x556a216de88c <unknown>
#9 0x556a216c6753 <unknown>
#10 0x556a21699a14 <unknown>
#11 0x556a2169ab7e <unknown>
#12 0x556a218e432e <unknown>
#13 0x556a218e7c0e <unknown>
#14 0x556a218ca610 <unknown>
#15 0x556a218e8c23 <unknown>
#16 0x556a218bc545 <unknown>
#17 0x556a219096a8 <unknown>
#18 0x556a21909836 <unknown>
#19 0x556a21924d13 <unknown>
#20 0x7f6bd20f6b43 <unknown>


Attempting to restart PC search in 500 seconds

@SiriusArc7
Copy link
Contributor

Have you tried on any other headless machines, like VM for example?

@amaan14999
Copy link

Let it restart the code after 500 secs. It usually works after that.

@bennyd87708
Copy link

same bug, searches not working in Docker headless

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants