Delete Google Browser History using Python Last Updated : 16 Jul, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report In this article, you will learn to write a Python program which will take input from the user as a keyword like Facebook, amazon, geeksforgeeks, Flipkart, youtube, etc. and then search your google chrome browser history for that keyword and if the keyword is found in any of the URL then it will delete it. For example, suppose you have entered the keyword 'geeksforgeeks', so it will search your google chrome history, like 'www.geekforgeeks.org', it's very obvious that this URL contains the keyword 'geeksforgeeks', then it will delete it, it will also search for articles (like "Is geeksforgeeks a good portal to prepare for competitive programming interview?") containing 'geeksforgeeks' in their title and delete it. First of all, get the location in your system where the google chrome history file is located. Note: Google chrome history file location in windows generally is: C:\Users\manishkc\AppData\Local\Google\Chrome\User Data\Default\History. Implementation: Python3 1== import sqlite3 # establish the connection with # history database file which is # located at given location # you can search in your system # for that location and provide # the path here conn = sqlite3.connect("/path/to/History") # point out at the cursor c = conn.cursor() # create a variable id # and assign 0 initially id = 0 # create a variable result # initially as True, it will # be used to run while loop result = True # create a while loop and put # result as our condition while result: result = False # a list which is empty at first, # this is where all the urls will # be stored ids = [] # we will go through our database and # search for the given keyword for rows in c.execute("SELECT id,url FROM urls\ WHERE url LIKE '%geeksforgeeks%'"): # this is just to check all # the urls that are being deleted print(rows) # we are first selecting the id id = rows[0] # append in ids which was initially # empty with the id of the selected url ids.append((id,)) # execute many command which is delete # from urls (this is the table) # where id is ids (list having all the urls) c.executemany('DELETE from urls WHERE id = ?',ids) # commit the changes conn.commit() # close the connection conn.close() Output: (16886, 'https://www.geeksforgeeks.org/') Comment More infoAdvertise with us Next Article Facebook Login using Python M mkumarchaudhary06 Follow Improve Article Tags : Python python-utility Python-projects Practice Tags : python Similar Reads Get Browser History using Python in Ubuntu In order to get the browser history of chrome and Mozilla Firefox browser os module and sqlite3 modules are used. The Chrome and Firefox history data are stored in SQLite database. So SQLite Python package is needed to extract the data from the browser history. Get History from Firefox The Firefox 3 min read Performing Google Search using Python code Let's say you are working on a project that needs to do web scraping but you don't know websites on which scraping is to be performed beforehand instead you are required to perform a google search and then proceed according to google search results to a few websites. In that case, you need google se 2 min read How To Automate Google Chrome Using Foxtrot and Python In this article, we are going to see how to automate google chrome using Foxtrot & Python. What is Foxtrot RPA?Robotic process automation (RPA) cuts down employeesâ workloads by automating repetitive, high-volume steps in processes. Software robots, such as Foxtrot RPA emulate the actions of hum 4 min read Facebook Login using Python Python scripting is one of the most intriguing and fascinating things to do meanwhile learning Python. Automation and controlling the browser is one of them. In this particular article, we will see how to log in to the Facebook account using Python and the power of selenium. Selenium automates and c 4 min read delete_cookie driver method - Selenium Python Seleniumâs Python Module is built to perform automated testing with Python. Selenium Python bindings provides a simple API to write functional/acceptance tests using Selenium WebDriver. To open a webpage using Selenium Python, checkout â Navigating links using get method â Selenium Python. Just bein 2 min read DELETE method- Python requests Requests library is one of the important aspects of Python for making HTTP requests to a specified URL. This article revolves around how one can make DELETE request to a specified URL using requests.delete() method. Before checking out the DELETE method, let's figure out what a Http DELETE request i 2 min read Like