selenium: [πŸ› Bug]: Selenium can get full html page source, but cannot get any element

What happened?

I use selenium to open one web page. Even though script sleep 10s to wait for the page to be loaded, and the page has fully loaded already. i can print the page source with all elements , but when i try to use selenium to find any element, there is : 、、、 selenium.common.exceptions.NoSuchElementException: 、、、 i cannot even find html or body element, but when i changed the website, the code works well ,i can get html or body element i am not sure it is because the web site has done something. Chrome: 125.0.6422.113 chrome driver: 125.0.6422.78

How can we reproduce the issue?

maybe not, because it is private web site in our company

Relevant log output

selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//*"}
  (Session info: chrome=125.0.6422.113); For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
Stacktrace:
0   chromedriver                        0x0000000102722510 chromedriver + 4302096
1   chromedriver                        0x000000010271ae58 chromedriver + 4271704
2   chromedriver                        0x000000010234c19c chromedriver + 278940
3   chromedriver                        0x000000010238e2c4 chromedriver + 549572
4   chromedriver                        0x00000001023c6c5c chromedriver + 781404
5   chromedriver                        0x0000000102383004 chromedriver + 503812
6   chromedriver                        0x00000001023839ec chromedriver + 506348
7   chromedriver                        0x00000001026ea558 chromedriver + 4072792
8   chromedriver                        0x00000001026ef004 chromedriver + 4091908
9   chromedriver                        0x00000001026d179c chromedriver + 3970972
10  chromedriver                        0x00000001026ef8ec chromedriver + 4094188
11  chromedriver                        0x00000001026c471c chromedriver + 3917596
12  chromedriver                        0x000000010270cb50 chromedriver + 4213584
13  chromedriver                        0x000000010270cccc chromedriver + 4213964
14  chromedriver                        0x000000010271aa50 chromedriver + 4270672
15  libsystem_pthread.dylib             0x0000000180c5a034 _pthread_start + 136
16  libsystem_pthread.dylib             0x0000000180c54e3c thread_start + 8

Operating System

macos

Selenium version

4.20.0

What are the browser(s) and version(s) where you see this issue?

Chrome: 125.0.6422.113

What are the browser driver(s) and version(s) where you see this issue?

chrome driver: 125.0.6422.78

Are you using Selenium Grid?

no

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (5 by maintainers)

Most upvoted comments

Hi, @softputer. Please follow the issue template, we need more information to reproduce the issue.

Either a complete code snippet and URL/HTML (if more than one file is needed, provide a GitHub repo and instructions to run the code), the specific versions used, or a more detailed description to help us understand the issue.

Note: If you cannot share your code and URL/HTML, any complete code snippet and URL/HTML that reproduces the issue is good enough.

Reply to this issue when all information is provided, thank you.