Skip to content

Using Selenium to extract ETF data from Cathay United Bank to Excel file with Safari.

License

Notifications You must be signed in to change notification settings

5j54d93/Cathay-United-Bank-ETF-to-Excel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cathay United Bank ETF to Excel

GitHub GitHub stars GitHub repo size

Using Selenium to extract ETF data from Cathay United Bank to Excel file with Safari.

Preparation

  • A Mac, so you could use Safari
  • Allow "remote automation" in Safari
  1. Choose Safari > Preferences, and on the Advanced tab, select "Show Develop menu in menu bar."
  2. Choose Develop > Allow Remote Automation.

Flow Chart

try:

  1. Set up web driver:Safari
  2. Open EFT website on Cathay United Bank
  3. New or open a excel file named Cathay-United-Bank-ETF.xlsx
  4. Initial Excel cell format
  5. Wait for website to load completely:until price of the last row not equal to "-"
  6. Extract tabletheadtbody
  7. Write column title to Excel file, and set font to bold
  8. Write table data to Excel file:add new line on EFT name cell and price cell
  9. Save and close Excel file
  10. Quit web driver

except Exception:

  1. If an Excel file have been opened, close it
  2. If a web driver have been created, quit it
  3. Rerun main.py by os.execv(sys.executable, ['python3'] + sys.argv)

License:MIT

This package is MIT licensed.

About

Using Selenium to extract ETF data from Cathay United Bank to Excel file with Safari.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Languages