Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ran Script, nothing happened #37

Closed
edshaw42 opened this issue Feb 4, 2023 · 33 comments
Closed

Ran Script, nothing happened #37

edshaw42 opened this issue Feb 4, 2023 · 33 comments
Labels
dependency User has issues with the dependencies

Comments

@edshaw42
Copy link

edshaw42 commented Feb 4, 2023

Installed locally on my mac, when I passed it the info my terminal just sat. Ended up checking in manually on my phone. I most likely did something wrong, but is there a good way to test this for future use cases?

@jdholtz
Copy link
Owner

jdholtz commented Feb 4, 2023

That’s strange. How long did you let it sit? Sometimes the browser can take a while to navigate the web page. If the check-in was less than 24 hours ago, you should be able to check in with the script again as Southwest wouldn’t have closed it yet.

@edshaw42
Copy link
Author

edshaw42 commented Feb 5, 2023

Is there a way to log what it's doing? Trying again, and nothing is happening. I am already manually checked into the flight.

It seems like it's doing things, but can't get any clarity?

@edshaw42
Copy link
Author

edshaw42 commented Feb 5, 2023

image

@edshaw42
Copy link
Author

edshaw42 commented Feb 5, 2023

Just sits here

@jdholtz
Copy link
Owner

jdholtz commented Feb 5, 2023

It will still work fine even if you are already checked in to your flight. Unfortunately, there are no logs yet. What version of Google Chrome are you running? It seems to most likely be an issue with the web browser.

If you want to debug it more, you’ll have to add your own code in the script (I have plans to add a logger soon). You can put print("debug") between lines 46 and 47 in lib/webdriver.py and re-execute the script to see if it prints anything out. If it doesn’t, it’s an issue with the browser.

@edshaw42
Copy link
Author

edshaw42 commented Feb 5, 2023

image

![Uploading image.png…]()

@edshaw42
Copy link
Author

edshaw42 commented Feb 5, 2023

python3 downloads/auto-southwest-check-in-master/southwest.py
Traceback (most recent call last):
File "/Users//downloads/auto-southwest-check-in-master/southwest.py", line 41, in
set_up(arguments)
File "/Users//downloads/auto-southwest-check-in-master/southwest.py", line 31, in set_up
flight_retriever.checkin_scheduler.refresh_headers()
File "/Users//Downloads/auto-southwest-check-in-master/lib/checkin_scheduler.py", line 81, in refresh_headers
webdriver.set_headers()
File "/Users//Downloads/auto-southwest-check-in-master/lib/webdriver.py", line 62, in set_headers
driver = self._get_driver()
File "/Users//Downloads/auto-southwest-check-in-master/lib/webdriver.py", line 44, in _get_driver
driver = Chrome(options=self.options, seleniumwire_options=self.seleniumwire_options)
File "/opt/homebrew/lib/python3.10/site-packages/seleniumwire/undetected_chromedriver/webdriver.py", line 61, in init
super().init(*args, **kwargs)
File "/opt/homebrew/lib/python3.10/site-packages/undetected_chromedriver/init.py", line 242, in init
patcher.auto()
File "/opt/homebrew/lib/python3.10/site-packages/undetected_chromedriver/patcher.py", line 130, in auto
self.unzip_package(self.fetch_package())
File "/opt/homebrew/lib/python3.10/site-packages/undetected_chromedriver/patcher.py", line 166, in fetch_package
return urlretrieve(u)[0]
File "/opt/homebrew/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 241, in urlretrieve
with contextlib.closing(urlopen(url, data)) as fp:
File "/opt/homebrew/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 216, in urlopen
return opener.open(url, data, timeout)
File "/opt/homebrew/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 519, in open
response = self._open(req, data)
File "/opt/homebrew/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 536, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
File "/opt/homebrew/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 496, in _call_chain
result = func(*args)
File "/opt/homebrew/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 1391, in https_open
return self.do_open(http.client.HTTPSConnection, req,
File "/opt/homebrew/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 1352, in do_open
r = h.getresponse()
File "/opt/homebrew/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1374, in getresponse
response.begin()
File "/opt/homebrew/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 318, in begin
version, status, reason = self._read_status()
File "/opt/homebrew/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 287, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response

@jdholtz
Copy link
Owner

jdholtz commented Feb 5, 2023

It could potentially be because the undetected_chromedriver package is downloading a different architecture for ChromeDriver (rather than ARM). I can add a configuration option to provide a path to a custom ChromeDriver. Then, you can download a version that works for you and use that instead.

@edshaw42
Copy link
Author

edshaw42 commented Feb 8, 2023

ImportError: DLL load failed while importing _brotli: The specified module could not be found.

Tried installing on a windows server I have to see if that was my issue, getting this now.. Ideas?

@schmeed
Copy link

schmeed commented Feb 8, 2023

ImportError: DLL load failed while importing _brotli: The specified module could not be found.

Tried installing on a windows server I have to see if that was my issue, getting this now.. Ideas?

Got the same error and the fix was to install Visual C++ redistributable.
https://learn.microsoft.com/en-US/cpp/windows/latest-supported-vc-redist?view=msvc-170

@jdholtz
Copy link
Owner

jdholtz commented Feb 8, 2023

I found the same fix here. Thanks for sharing that @schmeed.

@edshaw42
Copy link
Author

edshaw42 commented Feb 8, 2023

Awesome, that got me a step further haha. Now getting undetected chrome driver, but I think that's been talked about

@edshaw42
Copy link
Author

edshaw42 commented Feb 8, 2023

Awesome, that got me a step further haha. Now getting undetected chrome driver, but I think that's been talked about

image

@jdholtz
Copy link
Owner

jdholtz commented Feb 8, 2023

There are more details about this issue here. Could you try updating Google Chrome to the latest version? Should be 110.0.5481.77.

@edshaw42
Copy link
Author

edshaw42 commented Feb 8, 2023

@jdholtz - downloaded the most recent ChromeDriver but chrome is at .78 now.. Could the mismatch be the issue? Getting the same error in connection to chrome.

@jdholtz
Copy link
Owner

jdholtz commented Feb 8, 2023

What is your version of ChromeDriver? They need to be the same version (undetected chromedriver should've handled downloading the latest version for you).

@edshaw42
Copy link
Author

edshaw42 commented Feb 9, 2023

@jdholtz - so I just used a reservation from earlier in the week that's expired just to see if I could test it.
image
Do we think this means it would have worked?

@jdholtz
Copy link
Owner

jdholtz commented Feb 9, 2023

Yes, it should output that as the reservation is no longer valid. The error at the end can be ignored as it didn't affect the script until it was finished (this is also an error with undetected_chromedriver, not with this script). Could you try using your account information in the script? That will give us a much clearer idea of whether it worked or not. It should say "Successfully logged into ...'s account".

@edshaw42
Copy link
Author

edshaw42 commented Feb 9, 2023

@jdholtz
image

jdholtz added a commit that referenced this issue Feb 9, 2023
This should fix many issues users have with Chromedriver on different
architectures (undetected_chromedriver won't always download the correct
chromedriver). It also gives users the option to not have to keep Google
Chrome up to date as it just needs to match the version of the
Chromedriver specified. Hopefully fixes #37 and #39.
@jdholtz
Copy link
Owner

jdholtz commented Feb 9, 2023

This means it failed to log in. I catch this error in the develop branch, so hopefully in the future it will be more informative.

Anyways, there are actually issues with version 110 of Google Chrome currently (see #39). I have a fix on the chrome_configuration branch. Can you try downgrading Google Chrome to version 109 and downloading Chromedriver 109 from here? Make sure to specify the chromedriver_path in the config.json (you can see the details in the Configuration Doc).

To get those changes, run git pull && git checkout chrome_configuration

@jdholtz
Copy link
Owner

jdholtz commented Feb 9, 2023

It would also be great if you could try downloading the chromedriver version that goes with your mac (make sure to select the right architecture too) and specifying its path in the config.json. This could potentially be the issue you are facing on there.

@edshaw42
Copy link
Author

edshaw42 commented Feb 9, 2023

@jdholtz - I may not be your best test dummy.

I have downgraded both to 109x and installed version 109 chromedriver. Downloaded your commit, unzipped, put on root, ran pip install requirements. Updated config to point towards driver with no luck.

Maybe I need a very detailed step by step if I am going to help you test. It's probably just my idiot self, haha.

@jdholtz
Copy link
Owner

jdholtz commented Feb 9, 2023

No worries. What issue are you running into? The same one? I highly advise you use git for versioning (using my command above) rather than manually downloading it.

@edshaw42
Copy link
Author

edshaw42 commented Feb 9, 2023 via email

@jdholtz
Copy link
Owner

jdholtz commented Feb 9, 2023

What Python version are you currently on?

Also, you can try running in Docker to see if it works there

@edshaw42
Copy link
Author

edshaw42 commented Feb 9, 2023

@jdholtz - 3.10.8 on mac, I think 3.11 on server.

Do you have some good step by step for docker, I am pretty new to all of this.

@jdholtz
Copy link
Owner

jdholtz commented Feb 9, 2023

The Readme should have all the steps you need to do. Just make sure you have docker installed before.

Edit: When you do the docker run command, exclude doing -d so it can run in the foreground.

@edshaw42
Copy link
Author

edshaw42 commented Feb 9, 2023

@jdholtz

Followed the instructions as you said in read me for docker, getting this:

Traceback (most recent call last):
File "/app/southwest.py", line 41, in
set_up(arguments)
File "/app/southwest.py", line 24, in set_up
flight_retriever.monitor_account()
File "/app/lib/flight_retriever.py", line 53, in monitor_account
flights = self._get_flights()
File "/app/lib/flight_retriever.py", line 65, in _get_flights
flights = webdriver.get_flights(self)
File "/app/lib/webdriver.py", line 90, in get_flights
driver = self._get_driver()
File "/app/lib/webdriver.py", line 44, in _get_driver
driver = Chrome(options=self.options, seleniumwire_options=self.seleniumwire_options)
File "/usr/local/lib/python3.10/dist-packages/seleniumwire/undetected_chromedriver/webdriver.py", line 61, in init
super().init(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/undetected_chromedriver/init.py", line 429, in init
super(Chrome, self).init(
File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/chrome/webdriver.py", line 81, in init
super().init(
File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/chromium/webdriver.py", line 106, in init
super().init(
File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py", line 288, in init
self.start_session(capabilities, browser_profile)
File "/usr/local/lib/python3.10/dist-packages/undetected_chromedriver/init.py", line 715, in start_session
super(selenium.webdriver.chrome.webdriver.WebDriver, self).start_session(
File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py", line 381, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py", line 444, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/errorhandler.py", line 249, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: cannot connect to chrome at 127.0.0.1:33981
from unknown error: unable to discover open pages
Stacktrace:
#0 0x55de029ced93
#1 0x55de0279d2d7
#2 0x55de027ca2f4
#3 0x55de027c12fc
#4 0x55de028064f4
#5 0x55de027fd353
#6 0x55de027cce40
#7 0x55de027ce038
#8 0x55de02a228be
#9 0x55de02a268f0
#10 0x55de02a06f90
#11 0x55de02a27b7d
#12 0x55de029f8578
#13 0x55de02a4c348
#14 0x55de02a4c4d6
#15 0x55de02a66341
#16 0x7f2cc54f8402

@jdholtz
Copy link
Owner

jdholtz commented Feb 9, 2023

This is the same error that is currently happening with Chrome 110. You can follow #39 for more information on this, but currently there isn’t a fix.

@edshaw42
Copy link
Author

@jdholtz - Installed Develop and was able to get logged in this time!!!

When is says it "scheduled" check in, what does it do exactly? Does power off of the server cause it to lose that schedule?

Also - with experience do what kind of boarding group number have you all gotten??

@jdholtz
Copy link
Owner

jdholtz commented Feb 14, 2023

Great to hear!

When is says it "scheduled" check in, what does it do exactly? Does power off of the server cause it to lose that schedule?

It will sleep until five seconds before the check-in. Then it will start trying to check-in until it either runs out of attempts or succeeds. If you power off your server, you will have to restart the script for it to reschedule the check-in

Also - with experience do what kind of boarding group number have you all gotten??

I usually get A45 to B15, although it definitely depends on how many people have prepaid and how fast your network connection is.

Were you able to get it to work on your Mac? I'm doubtful whether it will work on ARM architecture right now.

@edshaw42
Copy link
Author

@jdholtz - Awesome thanks for the insight, I got the apprise notifications working as well, awesome job on this man!

The mac is the next test, since it's up and running on the server. I will keep you updated.

@jdholtz
Copy link
Owner

jdholtz commented Feb 14, 2023

Great! Let me know in a GitHub discussion when you get a chance to test.

@jdholtz jdholtz closed this as completed Feb 14, 2023
@jdholtz jdholtz added the dependency User has issues with the dependencies label Feb 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependency User has issues with the dependencies
Projects
None yet
Development

No branches or pull requests

3 participants