Open sdv75 opened 1 month ago
This code works well in URL https://www.etsy.com/listing/1256868877/vintage-pear-shaped-emerald-engagement with Selenium. el = driver.find_element(By.CSS_SELECTOR, 'select#variation-selector-0 option[value="2709528525"]') el.click()
I have been unable to find a solution to this problem in Botosaurus for 3 days now. When click(), nothing happens. When a human_click(), it does not find the element and throws an exception. js_run() does not work also.
Does anyone here ever answered?
Anybody help me!!! Botazaurus can't do a simple click on the select option. I've been suffering for three days already. I've already tried all the options
@sdv75 have you found a way to do it? I have the same problem after migrating to v4.
def js_select(num_id: str, option_value: str) -> str:
return """
var select = document.getElementById('variation-selector-""" + num_id + """');
select.value = '""" + option_value + """';
select.dispatchEvent(new Event('change'));
"""
driver.run_js(js_select(str(i), rnd_value))
Thank you this is working perfectly!
In Selenium it could be done like this:
select_item = driver.find_element(By.ID, "#some_id") Select(select_item).select_by_value(random_value)
How to do this in Botasaurus?