You would do something like this, with requests/BeautifulSoup:
import requests
from bs4 import BeautifulSoup
data = {
'industry': '',
'rating': '',
'filter': '',
'page': 100, ### this is where you would select the specific page
'pageSize': 100,
'resourcePackage': 'Sustainalytics'
}
r = requests.post('https://www.sustainalytics.com/sustapi/companyratings/getcompanyratings', data=data)
soup = BeautifulSoup(r.text, 'html.parser')
print(soup.get_text(strip=True))
This would return the text response of that actual table (which is not a table per se, you would need to further isolate and select elements from html response - see the elegant response from Andrej):
Sera Prognostics, Inc.NAS:SERA23.9Medium ESG RiskSerba Dinamik Holdings Bhd.KLS:527944.6Severe ESG RiskSerco Group PLCLON:SRP19.1Low ESG RiskSercomm Corp.TAI:538824.3Medium ESG RiskSeres Therapeutics IncNAS:MCRB35.9High ESG RiskSeria Co. Ltd.TKS:278221.7Medium [....]
And you would do something like this with Selenium (which in itself is not a tool designed to send POST requests, hence it will execute Javascript to get the data and replace the information in page):
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains
chrome_options = Options()
chrome_options.add_argument("--no-sandbox")
webdriver_service = Service("chromedriver/chromedriver") ## path to where you saved chromedriver binary
browser = webdriver.Chrome(service=webdriver_service, options=chrome_options)
url='https://www.sustainalytics.com/esg-ratings'
browser.get(url)
print('sending xhr request..')
browser.execute_script('''
$.ajax({
type: 'POST',
url: 'https://www.sustainalytics.com/sustapi/companyratings/getcompanyratings',
data: 'industry=&rating=&filter=&page=100&pageSize=10&resourcePackage=Sustainalytics',
success: function(data){
$('#company_ratings').html(data);
}
});
''')
print('check page content, xhr response returned')
The table in page would be updated with page 100 information, and pagination would reflect that as well.