Answer the question
In order to leave comments, you need to log in
How to copy table from Google Sheets using Selenium?
Tell me, is it possible to do this without dancing with a tambourine. By dancing with a tambourine, I mean a dreary authorization in the service with registering your project and obtaining keys. The table is available at the link, the creator is not me.
I tried to parse HTML code, but for some reason I get not all the data from the page, but about half. I mean that if you open a page in the developer console and look at the code, then even there only the top half of the page will be visible. Scrolling down the table does not help. And it parses HTML in exactly the same way, half of the table.
Maybe there are Google Sheets API methods through which you can download the page in the desired format, for example, excel? Or a method for highlighting the desired range in the table?
Or in selenium a method to select all text on a page?
Answer the question
In order to leave comments, you need to log in
There is an export button in excel and other formats.
import requests
doc_id = "тут id дока"
r = requests.get(f'https://docs.google.com/spreadsheets/d/{doc_id}/export?format=xlsx&id={doc_id}')
with open(f'{doc_id}.xlsx', 'wb') as f:
f.write(r.content)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question