How to get the link of table from where data is coming onto html?

Viewed 14

For example there is a table like in this link https://leetcode.com/contest/weekly-contest-309/ranking How to access the database from where it is coming. Like let's say to get whole ranking table at a place

I tried reading HTML file but didn't get it One extension scrapes the table only How can we achieve this?

1 Answers

There is no simple answer here - it really depends how is it implemented on the server side. As rv.kvetch pointed you can get part of result from url: https://leetcode.com/contest/api/ranking/weekly-contest-309/?pagination=1&region=global

You can notice pagination query parameter here, indeed you can access second page, third page and so on. Sometimes there is some parameter like page_size implemented on server but it doesn't look like that case.

So to access full table you probably need to iterate over that pages and glue the results.

Related