- Trending Categories
- Data Structure
- Operating System
- MS Excel
- C Programming
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How can I delete an element in Selenium using Python?
var l = document.getElementsByClassName("tp-logo"); l.parentNode.removeChild(l);
The above script is to be passed as a parameter to the execute_script method.
Let us try to remove the highlighted logo from the below page −
- Related Articles
- How can I scroll a web page using selenium webdriver in python?
- How can I parse a website using Selenium and Beautifulsoup in python?
- How do I send a DELETE keystroke to a text field using Selenium with Python?
- How do I find an element that contains specific text in Selenium WebDriver (Python)?
- How can I delete an item from an Object in MongoDB?
- How can I consistently remove the default text from an input element with Selenium?
- How can I clear text of a textbox using Python Selenium WebDriver?
- How can I get all element's immediate children with css selectors using selenium?
- How can I select an element by tag name using jQuery?
- How can I show and hide an HTML element using jQuery?
- How can I display an image using cv2 in Python?
- How can I perform mouse hover action in Selenium-Python?
- How can I manually set proxy settings in Python Selenium?
- How to find an element using the “XPath” in Selenium?
- How can I select an element by its class name using jQuery?