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

Issue with function main.getMatchUrls #5

Closed
micheledeantoni opened this issue May 21, 2024 · 4 comments
Closed

Issue with function main.getMatchUrls #5

micheledeantoni opened this issue May 21, 2024 · 4 comments

Comments

@micheledeantoni
Copy link

Dear Developers,

first of all I want to express my gratitude for making this package and making football data more available for everyone.
Sadly, after some weeks of usage with no issues I get this error now with the function getMatchUrls:

I'm encountering a NoSuchElementException when attempting to locate an element via XPath in Selenium. This error occurs when I try to interact with elements on a dynamically loaded webpage. Here is the complete traceback and code snippet where the error occurs:

Thank you in advance,

Michele

---------------------------------------------------------------------------
NoSuchElementException                    Traceback (most recent call last)
File ~/code/micheledeantoni/FSPM/data/main.py:168, in getMatchUrls(comp_urls, competition, season, maximize_window)
    166 driver.execute_script("window.scrollTo(0, 400)")
--> 168 match_urls = getFixtureData(driver)
    170 match_urls = getSortedData(match_urls)

File ~/code/micheledeantoni/FSPM/data/main.py:251, in getFixtureData(driver)
    250 if len(table_rows) == 0:
--> 251     if('is-disabled' in driver.find_element(By.XPATH, '//*[@id="date-controller"]/a[1]').get_attribute('class').split()):
    252         break

File ~/.pyenv/versions/3.10.6/envs/FSPM/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py:741, in WebDriver.find_element(self, by, value)
    739 value = f'[name="{value}"]'
--> 741 return self.execute(Command.FIND_ELEMENT, {"using": by, "value": value})['value']

File ~/.pyenv/versions/3.10.6/envs/FSPM/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py:347, in WebDriver.execute(self, driver_command, params)
    345 response = self.command_executor.execute(driver_command, params)
    346 if response:
--> 347     self.error_handler.check_response(response)

NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//*[@id=\"date-controller\"]/a[1]"}
(Session info: chrome=124.0.6367.208)
For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
Stacktrace:
0   chromedriver                        0x00000001031caa78 chromedriver + 5216888
1   chromedriver                        0x00000001031c26b3 chromedriver + 5183155
2   chromedriver                        0x0000000102d34527 chromedriver + 406823
3   chromedriver                        0x0000000102d7fff2 chromedriver + 716786
4   chromedriver                        0x0000000102d80181 chromedriver + 717185
5   chromedriver                        0x0000000102dc41d4 chromedriver + 995796
6   chromedriver                        0x0000000102da272d chromedriver + 857901
7   chromedriver                        0x0000000102dc16bf chromedriver + 984767
8   chromedriver                        0x0000000102da24a3 chromedriver + 857251
9   chromedriver                        0x0000000102d72fe3 chromedriver + 663523
10  chromedriver                        0x0000000102d7392e chromedriver + 665902
11  chromedriver                        0x0000000103188990 chromedriver + 4946320
12  chromedriver                        0x000000010318ea44 chromedriver + 4971076
13  chromedriver                        0x000000010316948e chromedriver + 4818062
14  chromedriver                        0x000000010318f559 chromedriver + 4973913
15  chromedriver                        0x0000000103159714 chromedriver + 4753172
16  chromedriver                        0x00000001031b1c08 chromedriver + 5114888
17  chromedriver                        0x00000001031b1dc7 chromedriver + 5115335
18  chromedriver                        0x00000001031c22d3 chromedriver + 5182163
19  libsystem_pthread.dylib             0x00007ff813f7c18b _pthread_start + 99
20  libsystem_pthread.dylib             0x00007ff813f77ae3 thread_start + 15
@Ali-Hasan-Khan
Copy link
Owner

Hi Michele! Due to frequent change of the whoscored website layout this keeps happening and yes, I am working on it. :)

@micheledeantoni
Copy link
Author

micheledeantoni commented May 22, 2024 via email

@Ali-Hasan-Khan
Copy link
Owner

I have fixed this bug you can check out if it works for you.

@micheledeantoni
Copy link
Author

micheledeantoni commented May 31, 2024 via email

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

2 participants