4

I have a google spreadsheet that functions as a quote calculator. I am using python-requests and beautifulsoup to:

  1. Grab values from the google sheet,
  2. login to a supplier's website
  3. Access their online quote calculator
  4. Populate the supplier's online quote form.
  5. Submit the form
  6. Scrape their quote data from the resulting html code.
  7. Populate the google sheet with their cost information

I don't need help with the python code or getting the python code to modify the googlesheet.

what I can't find seemingly anywhere is a good process for calling the python code from within the google sheet.

Ideally, I'd like to have an object in the google sheet (button? link?) that will trigger the web-scraping functionality. I have seen Google Sheets scripts that claim to populate a spreadsheet with scraped data from outside webpages, but these tools don't handle any site with authentication, hence the python angle.

Any suggestions much appreciated.

Everything I've found online explains how to get a process running on GAE to call a Google App script. Nothing about going the other way around.

1 Answer 1

2

Google Apps Script. You will need to use Apps Script to add a button or menu item to the sheet and then trigger your python script. You will have to make your python code accessible through some web api and call that api via Apps Script using the UrlFetch service.

Sign up to request clarification or add additional context in comments.

1 Comment

We ended up using google app script triggers. In the past, authentication to external web sites was not possible. Now, it is and we abandoned using python's web scraping libraries altogether.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.