SeleniumHQ / selenium

A browser automation framework and ecosystem.
https://selenium.dev
Apache License 2.0
30.75k stars 8.2k forks source link

Can't get script generated data - python API #9565

Closed ajrehl closed 3 years ago

ajrehl commented 3 years ago

Hey all. I've been testing out the python api for a few days, trying to get script generated data from several sites, However, I've failed up until this point, and I'm wondering if there's an issue.

Here is the code I am using:

from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By

url= "https://www.zillow.com/homes/90277_rb/"
WEBDRIVER_PATH = "./geckodriver.exe"

driver = webdriver.Firefox(executable_path=WEBDRIVER_PATH)
driver.get(url)

WebDriverWait(driver, 30).until(EC.visibility_of_element_located((By.ID, "grid-search-results")))
element=driver.find_element(By.ID,"grid-search-results")
print(element)

I've also played around with WebDriverWait for different expected condition methods (visibility_of_element_located, presence_of_element_located) for different IDs, classNames, and XPATHs. Nothing helped.

I found in a forum in which someone suggested executing scripts using

driver.execute_script("return document.documentElement.outerHTML")

but that didn't do anything either.

Has anyone run into this issue before? I've attached an image below showing that the id "grid-search-results" does in fact exist in the dom at the url listed in the code.

Thanks for your help.

Capture

ghost commented 3 years ago

👋 Hi there! Thank you for creating this issue.

I am the Selenium Assistant Bot 🤖, I triage issues in this repository. If I can't do it, I label it to help maintainers identify issues that need triaging.

I am an Open Source project 🙌, post bugs or ideas here!

ghost commented 3 years ago

❗️ It seems this issue is not using any of the supported templates

💡 Supported issue types are (they start with):

Issue templates help this project to stay in shape, please use them and fill them out completely. By doing that you are helping the project because the community and maintainers can provide prompt feedback, and potentially solve the issue.

If you are asking a question, a better way to address this is:

If you think this is incorrect, please feel free to open a new issue.