trying to get this browser (selenium) to go through each webpage, or any set of actions to do in the function before moving to the NEXT webpage, or search.
if I enter a single word into the prompt, it will go there fine, but if I do two, it will error like it could not load.
my ultimate goal is to go to a webpage and scroll through many pages based after a single search, ie: shoes, clothes, etc
before moving to the next search and doing the same.
modules are:
selenium
time
regex (the import re)
import re
import sys
import io
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.chrome.options import Options
import time
def processingpage():
wordssplit = None
if wordssplit == None:
searchwords = input(“Enter a word(s) seperated by , @ or /”)
wordssplit = re.split(r"@,/", searchwords)
for eachword in wordssplit:
def InitializeSearch():
chrome_options = Options()
chrome_options.add_argument("--lang=en-US")
driver = webdriver.Chrome(options=chrome_options)
driver.get("https://www."+eachword+".com")
driver.maximize_window()
driver.execute_script("window.scrollTo(0, 1000)")
time.sleep(1)
driver.execute_script("window.scrollTo(0, 2000)")
time.sleep(1)
driver.execute_script("window.scrollTo(0, 3000)")
time.sleep(1)
driver.execute_script("window.scrollTo(0, 4000)")
time.sleep(1)
driver.execute_script("window.scrollTo(0, 4500)")
time.sleep(1)
InitializeSearch()**