My code takes user input and uses it to search for an item on a webpage. it scrapes the html code of the webpage in order to get the items that appeared as a result:
driver = webdriver.Chrome()
driver.get(urlItem)
#this last line is the one that's not working on heroku
item_list = driver.find_elements_by_class_name('price-history-link')
this is the html code:
<ul class="no-padding small-block-grid-3 large-block-grid-5 text-center word-wrap-break-word">
<li>
<a href="/item/7399/"><img src="/assets/imgs/items/7399.gif" alt="A Grey Faerie Doll" title="A Grey Faerie Doll" class="item-result-image"></a><br><a href="/item/7399/">A Grey Faerie Doll</a>
<br><span class="text-small"><a href="/item/7399/price-history/" class="price-history-link" title="October 31, 2019">2,400,000 NP</a></span>
</li>
</ul>
When I run the code locally, the bot works perfectly. When I run the exact same code from my hosting site (heroku), it doesn't return any items. I thought that maybe it was a loading issue, so I added a :
WebDriverWait(driver, 10).until(ec.visibility_of_element_located((By.CLASS_NAME, "price-history-link")))
when this code is in place, it returns an exception (only when run on the hosting site, it works perfectly when run on my pc)
raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.TimeoutException: Message:
yes, the exception ends there, it doesnt actually show me the message.
I really don't understand why it won't work on heroku... any help is very appreciated!
Edit: Put in a catch for a NoSuchElementException, but it didn't catch anything