I am trying to get data from a dynamically generated web page. From my searches I found that Selenium is probably the best option to go with but I am running into some issues. The web page that I want to get data from is this one and my test search data is "10403782"
So far I have the following source code that is able to locate the search bar and search but as you can see the result back is multiple items, and I am trying to locate the one that doesn't have the small house to the left greyed out.
# Initial connection and search
driver.get("http://firmaopslag.dk")
element = driver.find_element_by_id("firmanavn")
element.send_keys("10403782")
element.send_keys(Keys.RETURN)
# On search result page, find the result with the house
searchResults = driver.find_element_by_id("searchresult")
I think that one way to locate the blue house is by looking at the color value, loop through all result items and find the one that doesn't have the house color that matches the grey one. However, whenever I make a search as in the case above searchResults is always empty. I tried searching by class name, id, tags .. nothing appears to be able to locate the results. Essentially as I mentioned I want to locate the result with the blue house and click on it.
EDIT: I think my biggest issue is that once the search is done I need to be looking at a different web page or a different element that what I've had so far from the initial page
Also for the final part, once I am on the correct page, I think beautifulsoup is the best way to get the data I am interested in, isn't it?