personal-coding / Live-Sports-Arbitrage-Bet-Finder

Automated bot that identifies live sports arbitrage opportunities across FanDuel, DraftKings, and William Hill (Caesars).
205 stars 46 forks source link

SyntaxError: invalid syntax #5

Closed jedistunnah closed 1 year ago

jedistunnah commented 1 year ago

F & D - Arb_Website - Two Person.py", line 98 match number: ^ SyntaxError: invalid syntax

This is what I get when I run the program.. I have all the requirements.

image

Any help you could provide to troubleshoot would be appreciated.

jedistunnah commented 1 year ago

Okay I have fixed that error. With python 3.10 you need to update the cdp file with the chrome driver to from collections.abc import Mapping, Sequence Now I am having a total different issue.

image Any idea on this fix?

I would also like to know what version of python you are using. Thanks

personal-coding commented 1 year ago

The response to this issue may help. Let me know if that doesn't solve your error.

jedistunnah commented 1 year ago

I did a clean install of python and tired both ways with the both If you use the undetected-chromedriver library, use import undetected_chromedriver as uc in the code If you use the undetected-chromedriver-modified library, use import undetected_chromedriver.v2 as uc in the code

Same results both ways. I did clean install with both... Also tried both with using python 3.10 same results. 

image

personal-coding commented 1 year ago

To confirm, do you have both undetected-chromedriver and undetected-chromedriver-modified libraries installed? I believe you can only have one installed. Having both can cause errors.

jedistunnah commented 1 year ago

I do not have both installed.

personal-coding commented 1 year ago

In Chrome, go to chrome://settings/help in your URL bar. There may be a relaunch option where your Chrome version is. Otherwise, try to upgrade your Chrome version. Your Chrome version may be different from the ChromeDriver version downloaded by the program.

caderob commented 1 year ago

I am having the same issues as well. Tried using multiple chrome versions as well as the most up to date version.

personal-coding commented 1 year ago

In this section of the code, try to remove the try, except and pass. See what kind of error the program throws.

jedistunnah commented 1 year ago

BOOM... I can't believe it the chrome version was out of date.. Good call i didn't even think about that. Thank you so much.

farhang1 commented 1 year ago

Hi Yuri, I did not quite understand how to resolve the match number:SyntaxError: invalid syntax. Jedi mentioned "Okay I have fixed that error. With python 3.10 you need to update the cdp file with the chrome driver to from collections.abc import Mapping, Sequence". I am not sure how to do it. Can you provide more details? Thanks

personal-coding commented 1 year ago

I think you have to go to C:\Users\your_username\AppData\Local\Programs\Python\Python310\Lib\site-packages\undetected_chromedriver\cdp.py (you'll have to find where your site-packages are located) and update from collections import Mapping, Sequence to from collections.abc import Mapping, Sequence

farhang1 commented 1 year ago

I think you have to go to C:\Users\your_username\AppData\Local\Programs\Python\Python310\Lib\site-packages\undetected_chromedriver\cdp.py (you'll have to find where your site-packages are located) and update from collections import Mapping, Sequence to from collections.abc import Mapping, Sequence

Thanks, Yuri. I had Python 3.9. I upgraded to the 3.11 and reinstalled all required packages. The issue was resolved. I can run the code now. I tried Fanduel and Draftkings file. Two chrome webpages and a small window with 'start' and 'stop' popped up. However, nothing happens after pressing the start button. Any idea?

personal-coding commented 1 year ago

The FanDuel XPath selectors needed updating. I've updated the code. Give it a try again with the latest code.