I am new to selenium. I am practicing selenium with this link: https://www.cagematch.net/?id=1&view=cards&year=2022&Day=&Month=&Year=2022&name=&promotion=1&showtype=Pay+Per+View
Here you can see the upcoming events. After clicking one of them It will show the matches. So, I want to fetch the links then also fetch the matches one by one. Like: At clash at castle there will be 5 matches, then on the next event there 5 matches. So, I want to fetch the list of events also the matches inside the events.
I have tried a little bit as, I am very new in selenium, can't figure out the idea to solve this issue. Here is my little code where I tried to do something but don't know what to do...
from selenium import webdriver
import os
from selenium.webdriver.common.by import By
import constant as const
class CageMatch(webdriver.Chrome):
def __init__(self, path=r"/usr/local/bin/SeleniumDriver/", teardown=False):
self.path = path
self.teardown = teardown
os.environ["PATH"] += self.path
super(CageMatch, self).__init__()
self.maximize_window()
def __exit__(self, exc_type, exc_val, exc_tb):
if self.teardown:
self.quit()
def find_web_page(self):
self.get(const.EVENTS_URL)
def extract_urls_from_td(self):
pass
As you can see I have a function called extract_urls_from_td.. I want this function to fetch all events href then it will go inside all the href then fetch the details. So what will be the easiest way of doing this?