Author Topic: Help on python script to download browseNotes  (Read 2285 times)


  • Newbie
  • *
  • Posts: 1
    • View Profile
    • Email
Help on python script to download browseNotes
« on: November 09, 2018, 09:31:50 AM »
I am trying to automate my investment. The only piece of the puzzle left for me is to download the market notes CSV. I'm aware that you can download the data through the lending club API. However, the data is not the same; there are fewer columns and often fewer notes. So I want to write a script to download the CSV. To do this you have to navigate to the sign in page, sign in, navigate to the manual invest page, and find the download link to the CSV. The reason you can't go directly to the CSV download link is that there is dynamic information in the link. For example:

I can sign in, navigate to the manual investment page, and find the dynamic link. But I can't seem to download the file. Here is my python code so far.

Code: [Select]
import requests
import re

username = 'email_address'
password = 'password'

# Start session
s = requests.Session()

# Navigate to the login page with login information in the header
url_login = ""
header = {'login_email': username,'login_password':password}
r1 =, data=header)

# Navigate to the browse notes to find the download link (it changes)
url_manual_invest = ''
r2 = s.get(url_manual_invest)

# Get the html code on the manual investment page
browse_all_html = r2.text

# Find the and extract the download link in the html code
pattern = '"*"'
text_result = re.findall(pattern, browse_all_html)

# The address is the first and only element in the list
address_with_quotes = text_result[0]

# Remove the quotes
url_notes_download = address_with_quotes[1:-1]

# So far everything is successful I have the download link for the CSV file
# However I can't seem to get the CSV data. Perhaps because it's a download link
# Here's what I have tried

r3 = s.get(url_notes_download)
data = r3.text

The page that I'm directed to is:

Does anyone know how to get this CSV?


  • Newbie
  • *
  • Posts: 37
    • View Profile
    • Email
Re: Help on python script to download browseNotes
« Reply #1 on: December 31, 2018, 03:56:07 AM »
did you figure this one out?


  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Help on python script to download browseNotes
« Reply #2 on: January 05, 2019, 11:37:33 AM »
I am winding my account down but I was investing using my own scripts up until last summer. Try the following. Best of luck.

Code: [Select]
import requests (among the others you need)

basic_header = {'authorization': 'YOUR_API_KEY'}
urlLoans = ''

r = requests.get(urlLoans, headers=basic_header)
loan_data = r.json()

# parse, filter, etc.