Scrapping Table Data with Python selenium

Final Exam, DANL 210-01, Spring 2024

Author

Byeong-Hak Choe

Published

May 10, 2024

Modified

March 1, 2026

📌 Directions

This is an exam on a paper, so minor coding errors are expected. My main focus is on your approach to each question — the logic, algorithms, and syntax you use. Nearly perfect code will be rewarded with bonus credit.


Data Collection

url = 'https://webscraper.io/test-sites/tables/tables-semantically-correct'


Question 1

  • Convert the first table in the above webpage into the DataFrame, table_0, using the pandas table scrapping method.



Question 2

  • Use selenium to load the webpage.
  • Then, scrap the all the data in the first table in the webpage using the selenium’s Inspect-find_element(s) strategy with for-loop.
  • Then, export the table data as a CSV file with the file name, table_0.csv
Back to top