0

Although I tried to get this coding done using pandas, xlrd etc libraries, but not able to get success till now. Problem Statement: So I have a website that is having two tables and I need to import both the tables into Excel and then filter it on date column and send the output on an email address.

Can someone help on this...!!!

1 Answers1

0

I see that you are a new contributor. Welcome, with this in mind I'll try to leave some nice resources that will give you a more holistic idea of solving the problem at hand.

For scraping the tables: BeautifulSoup has already completed templates out there for parsing through tables. This is touched on in another question (python BeautifulSoup parsing table)

For manipulating excel data: Openpyxl is a library that I have a small amount of experience with. It has at least limited functionality in manipulating excel spreadsheets. Here is a good resource for learning this (https://automatetheboringstuff.com/chapter12/)

For sending the files in an email: Python has a library for Simple Mail Transfer Protocol, what email often uses. The smtp and email modules make this possible, although I haven't done it personally. (https://docs.python.org/3.7/library/email.html#module-email) (https://docs.python.org/3.7/library/smtplib.html#module-smtplib)

Best of luck!

  • I tried to read table content but got below error : import pandas as pd con = pd.read_html("https://confluence.hk.hsbc/display/cvit/Release+Calendar") con.to_csv(r"C:\Users\44101400\Release Comm Project\mydata.csv", index=False) Error: --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) in () ----> 1 con.to_csv(r"C:\Users\44101400\Release Comm Project\mydata.csv", index=False) AttributeError: 'list' object has no attribute 'to_csv' – Nawin Mallick Nov 22 '18 at 03:12