Я пытаюсь разобрать содержание вопросов интервью по Leetcode.
Например, по https://leetcode.com/problems/two-sum/,
Я пытаюсь получить
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.
Это не казалось таким сложным.Я использовал запросы и BeautifulSoup, чтобы сделать это:
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())
Однако, как вы можете видеть в ответе страницы на странице через консоль разработчика (F12), ответ не включает содержимое, показанное настр.
Есть ли способ получить этот контент?