I am using the following script to read search terms from a file and then search those terms in google (each search result in it's own tab).
from selenium import webdriver
browser = webdriver.Chrome()
# first tab
browser.get('https://google.com')
with open("google-search-terms.adoc") as fin:
for line_no, line in enumerate(fin):
line = line.strip()
line = line.replace(' ', '+')
line = line.replace('&', '%26')
browser.execute_script(
"window.open('https://www.google.com/search?q="+line+"');")
How can I make this code better?