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

english branch using amazon.com ? #10

Open
cloud-aware opened this issue Nov 21, 2020 · 12 comments
Open

english branch using amazon.com ? #10

cloud-aware opened this issue Nov 21, 2020 · 12 comments
Assignees

Comments

@cloud-aware
Copy link

Hi, can you make a branch that works for amazon.com (english) ?

@cloud-aware
Copy link
Author

cloud-aware commented Nov 21, 2020

and would it be as simple as changing line 40 in main.py to be:

shop = shop.split('Sold')[0].split('This product is,')[1]

@druyang
Copy link

druyang commented Nov 23, 2020

There are a few more changes, I am currently making some changes to the script in my own branch

@cloud-aware
Copy link
Author

@druyang, excellent, was trying to use this to snag the xbox series x :-D

@druyang
Copy link

druyang commented Nov 23, 2020

@Skullduggeryism I hit a snag with getting selenium to work on my system, going to try later. here's the latest branch, see if it works for you:

https://github.com/druyang/amazon-PS5-automation/tree/english-qol-updates

@yosh1
Copy link
Owner

yosh1 commented Dec 1, 2020

@Skullduggeryism @druyang

Sorry, I didn't notice your comment.
Please PR your branch to my branch.
I can review your code and incorporate it.

@theNewMKE
Copy link

@yosh1 @druyang
Hi guys, I have a question here. I used the English version @druyang has attached here. I am pretty sure I have installed everything correctly. But when I run the main.py file, it just opens the item URL but it won't sign in to amazon automatically. And it won't proceed to the checkout page as well. Could you guys help me with it? Thank you so much.

@cloud-aware
Copy link
Author

cloud-aware commented Dec 16, 2020

@yosh1 @druyang
Hi guys, I have a question here. I used the English version @druyang has attached here. I am pretty sure I have installed everything correctly. But when I run the main.py file, it just opens the item URL but it won't sign in to amazon automatically. And it won't proceed to the checkout page as well. Could you guys help me with it? Thank you so much.

Make sure you have 2FA (two factor authentication) turned off on your Amazon account, and make sure you have copied the ".env.sample" file to ".env" and made the appropriate changes to that file.

Edit: also, I would use the default branch, as I believe it's newer than the update branch

@druyang
Copy link

druyang commented Dec 16, 2020

@yosh1 @druyang
Hi guys, I have a question here. I used the English version @druyang has attached here. I am pretty sure I have installed everything correctly. But when I run the main.py file, it just opens the item URL but it won't sign in to amazon automatically. And it won't proceed to the checkout page as well. Could you guys help me with it? Thank you so much.

This sounds like the environment variables weren't moved in correctly. Could you also paste the logs of the program? When you get the sign in failure + failure to checkout?

@theNewMKE
Copy link

Thank you so much for replying! I just checked I do not have the 2FA on my Amazon account. And I did copy the ".env.sample" file to ".env" file with appropriate changes(my Amazon email and password). So when I run the program, it pops up a window like this:
Screenshot from 2020-12-15 21-42-19
The top right asks me to sign in and then the program does nothing and kinda just stays where it is.
When I close this window and wait for about 1 min. My terminal gives me this:

Traceback (most recent call last):
File "main.py", line 44, in
raise Exception("not Amazon.")
Exception: not Amazon.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "main.py", line 50, in
b.refresh()
File "/home/user/anaconda3/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 831, in refresh
self.execute(Command.REFRESH)
File "/home/user/anaconda3/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/home/user/anaconda3/lib/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: chrome not reachable
(Session info: chrome=87.0.4280.66)

@druyang
Copy link

druyang commented Dec 16, 2020

It won't log in unless the item is instock and by Amazon (hence the first exception).

Second exception looks a little weird. What version of selenium + chrome + driver do you have? Chrome and your driver should match versions

@theNewMKE
Copy link

I have tried something that is in stock on Amazon. The program acts the same without the first exception.
For selenium, I used version 3.141.0, which is written in the "requirements.txt" by @yosh1
I check my chrome version: Version 87.0.4280.66 (Official Build) (64-bit)
And when I type “chromedriver" in the terminal, it shows "Starting ChromeDriver 87.0.4280.88“
The only difference is the last two digits, 66 and 88. Does this make a difference? But the "88" is what I download from the chromedriver website and I cannot find "66" version there. Thank you.

@yosh1 yosh1 self-assigned this Dec 16, 2020
@theNewMKE
Copy link

Guys, I have played with my code several times and I found out if I comment out line 38 to line 44, this code actually works. So I basically just comment out the part it detects if the merchant is from Amazon. But when I add these lines back, it gives me an error:
Traceback (most recent call last):
File "main_copy.py", line 38, in
shop = b.find_element_by_id('merchant-info').text
File "/home/user/anaconda3/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 360, in find_element_by_id
return self.find_element(by=By.ID, value=id_)
File "/home/user/anaconda3/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 976, in find_element
return self.execute(Command.FIND_ELEMENT, {
File "/home/user/anaconda3/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/home/user/anaconda3/lib/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":"[id="merchant-info"]"}
(Session info: chrome=87.0.4280.66)

I think it has to do with the "find_element_by_id('merchant-info').text" part. My machine just doesn't like it. So how should I change this part to make it work? @yosh1 @druyang. Thank you

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

No branches or pull requests

4 participants