Skip to content

Instantly share code, notes, and snippets.

@serhii73
Created June 27, 2017 20:26
Show Gist options
  • Save serhii73/642b24805ff2dcdd33fb7c681fd7c2a9 to your computer and use it in GitHub Desktop.
Save serhii73/642b24805ff2dcdd33fb7c681fd7c2a9 to your computer and use it in GitHub Desktop.
Get a table in the file
#!/usr/bin/python
# -*- coding: utf-8 -*-
import requests
import pandas as pd
url = "url_with_table"
df = pd.read_html(url)
df = df[0]
df.columns = df.iloc[0]
df = df[1:]
df.to_csv("file_name.csv", sep=',', encoding='utf-8', index=False)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment