Conclusion for Web Scraping and Saving to Excel

Concluding remarks for web scraping.

You were able to demonstrate the powerful ability to go to a website, get information from it, and put that information into a spreadsheet. The program will handle any column or row additions because of how you scrape the HTML. That does, however, make the program sensitive to any changes in the website’s HTML or general layout. If the layout does change, you would have to re-find the proper HTML tag that identifies the information. This is part-and-parcel of depending on websites for information; occasionally, the style changes, and you have to make your program reflect the changes. This is why APIs are preferred: they typically will not change or will not change significantly.

The ability to interface with Excel with the Openpyxl library means you can decouple VBA from Excel and use Python to run any code you have. The days of seeing IF(AND(OR(IFERROR(A5=A4, ""), A1 <> A6), B4 = TRUE), B3 = 1) may be over. Writing in Python is a better way to see readable logic, and now you know how to scrape websites and use Excel to display the results.

Get hands-on with 1400+ tech skills courses.