I am trying to parse the content of the interview questions on Leetcode.
For example, on https://leetcode.com/problems/two-sum/,
I am trying to get
Given an array of integers, return indices of the two numbers such that they add up to a specific target.
You may assume that each input would have exactly one solution, and you may not use the same element twice.
It didn't seem that hard. I used requests and BeautifulSoup to do it:
url = 'https://leetcode.com/graphql/two-sum'
try:
page = requests.get(url)
except (requests.exceptions.ReadTimeout,requests.exceptions.ConnectTimeout):
print('time out')
return 'time out'
soup = BeautifulSoup(page.content, 'html.parser')
print(soup.prettify())
However, as you can see in the response of the page on the page through developer console (F12), the response does not include the content shown on the page.
Is there a way to get this content?