Consultation on selecting the select option in the Botasaurus library in Python
Botasaurus library in Python https://github.com/omkarcloud/botasaurus ( !!! Make sure to install the latest version!!! )
Website page https://www.etsy.com/listing/1256868877/
The script needs to load this page and select both select options: size and materials.
And after that, click the "Add to cart" button.
After that, the item should be added to the cart.
It seems that everything is simple, but the latest version of Botasaurus, which works through cdp, cannot click on the required select option. The old version, which worked through webdriver and selenium, did this in one click. Attempts to solve this through js and requests also failed.
So please write only if you know Botasaurus and can really solve this quest.
-
711 4 0 I need to look at your code and test it. I am superficially familiar with Botasaurus, but I am well acquainted with Selenium, and since Botasaurus uses Selenium under the hood, the issue with selecting options is not new. I need to look at the code, test it, and check.
-
51 The problem with Botasaurus is that its latest version uses the CDP protocol, which may have limitations when working with select elements. The main actions that can be tried to resolve this:
1. **Direct interaction via JavaScript**: even if previous attempts through JS were unsuccessful, it might be worth trying more precise approaches to selecting options.
```python
script = """
document.querySelector('select#size-selector').value = 'desired-size';
document.querySelector('select#material-selector').value = 'desired-material';
"""
browser.execute_script(script)
… ```
2. **Check element visibility**: if Botasaurus uses the CDP protocol, the elements may not be displayed or may be hidden. It is necessary to ensure that the options are visible and available for clicks.
3. **Bypass through click emulation**: manually emulate key presses via CDP to select the desired values.
4. **Switch to Selenium**: if Botasaurus encounters limitations with the new version, consider using Selenium for this stage. Direct control over the WebDriver will allow everything to be done by clicking on the elements.
We can try these options to solve the problem, which will likely help fix the current situation.
-
Так це ж елементарно робиться. В офіційній документації є все вказано )))
-
Current freelance projects in the category Python
AI Commenting Platform for TikTok and Instagram.Project Goal Develop a system that allows managing a large number of TikTok and Instagram accounts and automatically posting relevant comments under selected videos using AI. Main Functionality1. Account Management It is necessary to implement the ability to connect accounts:… AI & Machine Learning, Python ∙ 1 day 6 hours back ∙ 18 proposals |
Build a customer classification model1. There is client data in Mongo/SQL (approximately 20,000 entries with raw data). 2. It is necessary to build features and a classification model of clients into behavioral groups based on this data. 3. The project should be completed in Python. AI & Machine Learning, Python ∙ 3 days back ∙ 38 proposals |
IT Automation of VAT Reporting
223 USD
It is necessary to develop a system for automating the transfer of sales data from the CRM to the accounting system Wafeq. The system should import bank and payment reports, automatically reconcile payments with invoices, generate invoices for VAT reporting, and minimize manual… AI & Machine Learning, Python ∙ 3 days 5 hours back ∙ 48 proposals |
Account reconciliation tool with the bank, cards, and accountantTechnical Assignment: Tool for Reconciling Accounts with Bank, Cards, and AccountantGeneral Goal A local tool (script/small application in Python) is needed, which is manually run once every 1-2 months on my computer and performs reconciliation between: Invoices I issued to… Python, Desktop Apps ∙ 3 days 18 hours back ∙ 43 proposals |
Automatic video posting on social media according to a scheduleTechnical Assignment (TA) Automatic video publication on social media according to a scheduleProject Description A script/bot (Python preferred, or any other solution of your choice — the main thing is stability and ease of maintenance) is needed, which automatically publishes… Python, Bot Development ∙ 4 days 6 hours back ∙ 59 proposals |