Hello I'm a beginner in python and I'm confused on where to go from here
How do I interact/click with a specific link after using bs4 to search for it? So in my script I use bs4 to search through links, that can be clicked on in the the webpage, with specific keywords so I click on the right product.
onSale = False # Set while loop variable
shoeName = 'moon' # Set keyword to look for
browser = webdriver.Chrome()
browser.get(r'https://www.nike.com/launch/?s=upcoming') # Get URL to scan
soup = BeautifulSoup(browser.page_source, 'html.parser') # Convert URL to a soup object
while onSale is False: # Create loop to keep checking inventory
for link in soup.find_all('a', class_=r'card-link d-sm-b'):
shoeCode = str((link.get('href', None), link.get_text()))
compareName = re.sub("[^\w]", " ", shoeCode.lower()).split() # Takes the link and converts it into a string
if shoeName in compareName: # Checks to see if the keyword is used
# Interact/Click link
else:
print(shoeCode)
continue
Once the proper link has been found how do I use it to interact with the website? Do I use selenium, urllib, and or requests? Thanks!