We all need datas. Now think how nice it would be if you can have datas in Tabular format and you can scrape it and can reuse it. Well, friends selenium makes is possible. You can do the same thing with beautifulsoup but the way is a bit more complicated. Here are the codes I wrote for scraping a table from wikipedia about tesla Inc.
For example, bellow is the table I want to scrape.
Now lets write some code using selenium and python.
First you import the necessary imports. Then define the driver.
Automate to the website by using driver.get("url") command. Find a elements in the row by using the driver.find_elements_by_xpath and the same for column as well. Use the for loop for getting all the elements in the table and get it in tabular form and print it in the end. Now the result after pushing the code.
Here you go. Have a nice day.