Post request returning empty or encoded - python
I am trying to make a post request to an api but I get an empty string as response or an encoded/encrypted one I dont understand well why(both respones i get a 200 OK repsonse). this is from the page I am trying to replicate the request: [Request Header from website].
thats the payload [the payload]
and this is my code:
headers = {
'authority': 'node1.web3api.com',
'method': 'POST',
'path' : '/',
'scheme': 'https',
'accept': '*/*',
'accept-encoding': 'gzip, deflate, br',
'accept-language': 'de,de-DE;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6',
'content-length': '252',
'content-type': 'application/json',
'origin' :'https://etherscan.io',
'referer': 'https://etherscan.io/',
'sec-ch-ua': '" Not A;Brand";v="99", "Chromium";v="96", "Microsoft Edge";v="96"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Windows"',
'sec-fetch-dest': 'empty',
'sec-fetch-mode': 'cors',
'sec-fetch-site': 'cross-site',
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36 Edg/96.0.1054.62'
}
payload = {"jsonrpc": "2.0", "id": 1, "method": "eth_call", "params": [
{"from": "0x0000000000000000000000000000000000000000",
"data": "0xc87b56dd0000000000000000000000000000000000000000000000000000000000000004",
"to": "0xd754937672300ae6708a51229112de4017810934"}, "latest"]}
with requests.session() as session:
session.get('https://etherscan.io/address/0xd754937672300ae6708a51229112de4017810934#readContract')
r = requests.post('https://node1.web3api.com/', headers=headers, data=json.dumps(payload))
print(r.text)
print(r.content)
print(r.status_code)
Related
Using API-Endpoint from website allways get invalid response?
i try to use the api-endpoint from this site: https://horoguides.com/hk/watch_finder I searched for the api-endpoint in the network-tab and try to rebuild this api-access with the following code: import requests url = "https://horoguides.com/hk/ajaj/watch/searchWatches" payload = { "addLimit": "LIMIT 0, 20", "addOrder": "ORDER BY establish DESC", } headers = { 'Accept': "application/json, text/javascript, */*; q=0.01", 'Accept-Language': "de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7", 'Connection': "keep-alive", 'Content-Type': "multipart/form-data; boundary=---011000010111000001101001", 'Cookie': "PHPSESSID=siob5k70qu4gh8bkio07qtocv3; _gid=GA1.2.40295814.1663575664; __gads=ID=2fc582d62ff2a986-223e4e8c26ce00a9:T=1663575664:RT=1663575664:S=ALNI_MaTX_1U4CELXasmH0td3MvCRQ5S5Q; _gat_UA-90322481-1=1; _gat_gtag_UA_90322481_1=1; _ga_6Z9E9PKG02=GS1.1.1663594500.3.1.1663594710.0.0.0; _ga=GA1.1.699639573.1663575664", 'Origin': "https://horoguides.com", 'Referer': "https://horoguides.com/hk/watch_finder", 'Sec-Fetch-Dest': "empty", 'Sec-Fetch-Mode': "cors", 'Sec-Fetch-Site': "same-origin", 'User-Agent': "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36", 'X-Requested-With': "XMLHttpRequest", 'sec-ch-ua': "^\^Chromium^^;v=^\^104^^, ^\^" } resp = requests.request("POST", url, json=payload, headers=headers) print(resp.status_code) respJSON = resp.json() print(respJSON) But as response i only get: 200 {'status': 'invalid'} Why is this reponse from the api-endpoint not working? I also tried to run this in Insomnia and get the same result.
You need to fix the payload. The following code works: import requests url = "https://horoguides.com/hk/ajaj/watch/searchWatches" payload = { "addLimit": "LIMIT 0, 20", "addOrder": "ORDER BY establish DESC", 'lang': 'hk', 'ajaxID': 'searchWatches' } headers = { 'Accept': "application/json, text/javascript, */*; q=0.01", 'Accept-Language': "de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7", 'Connection': "keep-alive", 'Origin': "https://horoguides.com", 'Referer': "https://horoguides.com/hk/watch_finder", 'Sec-Fetch-Dest': "empty", 'Sec-Fetch-Mode': "cors", 'User-Agent': "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36", 'X-Requested-With': "XMLHttpRequest" } resp = requests.request("POST", url, data=payload, headers=headers) print(resp.status_code) respJSON = resp.json() print(respJSON) Result in terminal: 200 {'act': 'watch/searchWatches', 'status': 'success', 'getData': {'a5124': {'id': '5124', 'name': '116610-LN-0001', 'url_name': '116610-ln-97200', 'establish': '2014', 'w_brand_id': '39', 'w_brand_abbr': '', 'w_brand_name': 'ROLEX', 'w_brand_urlname': 'rolex', 'w_brand_localname': '勞力士', 'hype_default_currency': 'NT$', 'w_series_name': 'SUBMARINER', 'w_series_urlname':[....] For requests documentation, see https://requests.readthedocs.io/en/latest/
Error 403: The supplied authentication is not authorized to access this resource
I want to send a POST request to the following URL and get the result. https://www.snapptrip.com/flights/THR-tehran/KIH-kish-island?roundTrip=false&adultCount=1&childCount=0&inLapCount=0&date=2022-07-01&cabinType=E To do this I have copied all headers and cookies from browser and set them like as follows: import json import requests header = { 'accept': 'application/json, text/plain, */*', 'accept-encoding': 'gzip, deflate, br', 'accept-language': 'en-US,en;q=0.9', 'cache-control': 'no-cache', 'content-length': '147', 'content-type': 'application/json;charset=UTF-8', 'cookie': 'route=1656317791.775.282.960981; _gcl_au=1.1.2046258357.1656317792; analytics_campaign={%22source%22:%22google%22%2C%22medium%22:%22organic%22}; analytics_token=42b8404c-38bc-f45a-5da5-4b0a9d8d64d3; _yngt_iframe=1; _yngt=7cf79f92-2a8e5-5857f-fc332-20702cb6182a1; _gid=GA1.2.1347682050.1656317794; _hjSessionUser_1680486=eyJpZCI6IjI4YzJkNDgxLWQ5ZmMtNTE0ZC04ODZmLWY0YmU4YWUzZTY0MyIsImNyZWF0ZWQiOjE2NTYzMTgwMjQwOTgsImV4aXN0aW5nIjp0cnVlfQ==; CustomerKey=c6daab9d-76a3-318b-9dc4-a998b9aa3d77; _clck=11btp2n|1|f2q|0; analytics_session_token=6fd59170-a4ac-3fe4-48c2-6672506db682; yektanet_session_last_activity=6/29/2022; _6193bae56a6d2e30f5357d82=true; _hjIncludedInSessionSample=0; _hjSession_1680486=eyJpZCI6IjhlNGU0MWQ4LThmM2QtNGQyNy05YjY2LTRmMDViYTQzYjM3ZCIsImNyZWF0ZWQiOjE2NTY0NzgwOTM2NTUsImluU2FtcGxlIjpmYWxzZX0=; _hjAbsoluteSessionInProgress=0; crisp-client%2Fsession%2Fdb7f3f50-c4be-4ec3-85f9-24c3cff11750=session_8eb3f713-17e8-4046-ad90-ecec16421bed; marketingData={"utm_medium":"","utm_campaign":"","utm_source":"","utm_content":"","utm_term":"","referrer":"https://www.snapptrip.com/flights/THR-tehran/MHD-mashhad?date=2022-08-22&returnDate=&roundTrip=false&adultCount=1&childCount=0&inLapCount=0&cabinType=E"}; flightMarketingData={"utm_medium":"","utm_campaign":"","utm_source":"","utm_content":"","utm_term":"","referrer":"https://www.snapptrip.com/flights/THR-tehran/MHD-mashhad?date=2022-08-22&returnDate=&roundTrip=false&adultCount=1&childCount=0&inLapCount=0&cabinType=E"}; destinationCity=%D9%85%D8%B4%D9%87%D8%AF; _gat_UA-107687430-1=1; _ga_DKJN1PETDV=GS1.1.1656478091.3.1.1656480799.49; _ga=GA1.2.312049892.1656317793; _clsk=1bf2oby|1656480801280|29|1|h.clarity.ms/collect', 'origin': 'https://www.snapptrip.com', 'pragma': 'no-cache', 'referer': ' https://www.snapptrip.com/flights/THR-tehran/MHD-mashhad?roundTrip=false&adultCount=1&childCount=0&inLapCount=0&date=2022-06-30&cabinType=E', 'sec-ch-ua': '" Not A;Brand";v="99", "Chromium";v="100", "Google Chrome";v="100"', 'sec-ch-ua-mobile': '?0', 'sec-ch-ua-platform': 'Linux', 'sec-fetch-dest': 'empty', 'sec-fetch-mode': 'cors', 'sec-fetch-site': 'same-origin', 'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.88 Safari/537.36', 'x-access-token': '26a53f65-4702-4f99-a5d3-ed03e03ca6e6', 'x-customer-key': 'c6daab9d-76a3-318b-9dc4-a998b9aa3d77', 'x-request-id': 'Bearer db312b1422dc4ec4f657de5909612a238af4592d5c25828cccb5bb319090fbf8.e7cf77e7-1d36-489d-9df3-ada35364681e', 'x-session-id': '3cfbed40-7932-46ee-9513-f342813be7c3', 'x-user-id': '71d3efa6-6d61-4d3d-89b2-16f1e1a201a1', } data = {"origin": "THR", "destination": "MHD", "roundTrip": false, "passengers": {"adults": 1, "children": 0, "infants": 0}, "cabinType": "E", "departDate": "2022-06-30"} url = 'https://www.snapptrip.com/flights/THR-tehran/KIH-kish-island?roundTrip=false&adultCount=1&childCount=0&inLapCount=0&date=2022-07-01&cabinType=E' res = requests.post(url=url, json=json.dumps(data), headers=header) The header and cookie images in the browser are as follows: After all, it throws following error: 403: The supplied authentication is not authorized to access this resource
Need help isolating results from xhr request
When I run the code below, it's giving me a lot of information I don't want. I only want to capture the data circled starting with 4. Does anyone know how to isolate the data in the request to get rid of everything but what is circled? Also, if anyone knows how to bring the results to a csv or xlsx file, that would be even better. Working code: import requests url = "https://www.stockrover.com/stock_infos/grid?_dc=1644769629231" data = { "ticker": 4, "rank": "5", } payload = "state=%7B%22sortInfo%22%3A%7B%7D%2C%22columns%22%3A%5B77%2C32%2C498%2C500%2C31%2C27%2C499%2C30%2C578%2C28%2C29%2C544%2C181%2C185%2C186%5D%2C%22view%22%3A281%2C%22priorPrimaryColumn%22%3A170%2C%22filterData%22%3A%5B%5D%2C%22name%22%3A%22New%201%22%2C%22cType%22%3A%22Screener%22%2C%22cNode%22%3A%22s_39%22%2C%22cIsFolder%22%3Afalse%2C%22gridSelection%22%3A%22BTU%22%2C%22lastActive%22%3A1396898415%2C%22primaryColumn%22%3A76%2C%22folderDisabledParams%22%3A%7B%22filterData%22%3A%5B%5D%7D%2C%22mainGridDateRange%22%3A%22ytd%22%2C%22groupState%22%3Anull%2C%22moversGridDateRange%22%3A%221_day%22%2C%22peersGridDateRange%22%3A%221_day%22%2C%22lastGridSelections%22%3A%5B%22BTU%22%5D%2C%22lastQuantNode%22%3A%5B%5D%2C%22includeQuotesInTable%22%3Afalse%2C%22includeAllQuotesLastValue%22%3Afalse%2C%22markets%22%3A%7B%22panel%22%3A%22summary%22%7D%2C%22researchPanel%22%3A%22tablePanel%22%2C%22recentSearchTickers%22%3A%5B%22SPY%22%2C%22AMZN%22%2C%22AAPL%22%2C%22s_32%22%2C%22%5ENDX%22%2C%22AXP%22%2C%22XOM%22%2C%22AFL%22%2C%22%5EDJX%22%2C%22AIT%22%2C%22ADVC%22%5D%2C%22quotesBoxTickers%22%3A%5B%22AMZN%22%2C%22AAPL%22%2C%22SPY%22%5D%2C%22checkedQuotesBoxTickers%22%3A%5B%22AMZN%22%2C%22AAPL%22%2C%22SPY%22%5D%2C%22dashboard%22%3A%7B%22buttonRef%22%3A%22272%22%7D%2C%22tickerSelectedFeeds%22%3A%5B%22Benzinga%20News%22%2C%22Yahoo%20News%22%5D%2C%22marketSelectedFeeds%22%3A%5B%22Google%20News%22%2C%22Stock%20Market%20News%20-%20Investing.com%22%5D%2C%22bondsSelectedFeeds%22%3A%5B%22Bonds%20Strategy%20-%20Investing.com%22%5D%2C%22commoditiesSelectedFeeds%22%3A%5B%22Commodities%20%26%20Futures%20News%20-%20Investing.com%22%2C%22Commodities%20Fundamental%20Analysis%20-%20Investing.com%22%2C%22Commodities%20Strategy%20Analysis%20-%20Investing.com%22%5D%2C%22stocksSelectedFeeds%22%3A%5B%22CNNMoney%20News%22%2C%22Google%20News%22%2C%22Seeking%20Alpha%20Top%20Stories%22%5D%2C%22etfsSelectedFeeds%22%3A%5B%22Economy%20News%20-%20Investing.com%22%2C%22ETF%20Analysis%20-%20Investing.com%22%2C%22Investing%20Ideas%20-%20Investing.com%22%5D%2C%22topPanel%22%3A%22researchPanel%22%2C%22maxRecordsNode%22%3Afalse%2C%22version%22%3A7%2C%22lastGridSelectionsRaw%22%3A%5B%22BTU%22%5D%2C%22lastSelectionScreeners%22%3A%22s_39%22%2C%22quotesDisabled%22%3Atrue%2C%22lastSelectionPortfolios%22%3A%22p_2%22%2C%22comparisonPanels%22%3A%7B%22Portfolio%22%3A%22p_2%22%2C%22Index%22%3A%22%5EDJX%22%2C%22Watchlist%22%3A%22Watchlists%22%2C%22Screener%22%3A%22s_39%22%7D%2C%22lastSelectionWatchlists%22%3A%22w_26%22%2C%22indicesSelectedFeeds%22%3A%5B%22Google%20News%22%2C%22Yahoo%20News%22%5D%2C%22newsActive%22%3A%22tickerNews%22%2C%22recentSearchMetrics%22%3A%5B%22Price%22%2C%22EPS%22%2C%22Sales%22%5D%2C%22editPanel%22%3A%22positionsPanel%22%2C%22newsType%22%3A%22marketNews%22%2C%22tableColumns%22%3A%5B%22ticker%22%2C%22rank%22%2C%22score_rank%22%2C%22filter_score%22%2C%22company%22%2C%22cash%22%2C%22currentassets%22%2C%22netppe%22%2C%22intangibles%22%2C%22totalassets%22%2C%22currentliabilities%22%2C%22longtermdebt%22%2C%22totaldebt%22%2C%22totalliabilities%22%2C%22equity%22%2C%22tangiblebookvalue%22%2C%22cash_short_term_p%22%2C%22net_ppe_p%22%2C%22intangibles_p%22%5D%2C%22last_save%22%3A1644769379%2C%22panels%22%3A%7B%22collapsed%22%3A%7B%22chp%22%3Atrue%2C%22ip%22%3Atrue%2C%22mp%22%3Afalse%2C%22qp%22%3Afalse%2C%22conp%22%3Atrue%2C%22fsp%22%3Afalse%7D%2C%22viewportWidth%22%3A%221920%22%2C%22viewportHeight%22%3A%221069%22%2C%22chartPanelHeight%22%3A483%2C%22controlPanelWidth%22%3A296%2C%22insightPanelWidth%22%3A%22485%22%2C%22quoteBoxHeight%22%3A200%2C%22navigationPanelWidth%22%3A277%7D%7D&updateMarket=true&page=1&start=0&limit=250" headers = { 'authority': 'www.stockrover.com', 'sec-ch-ua': '" Not A;Brand";v="99", "Chromium";v="98", "Google Chrome";v="98"', 'x-csrf-token': '7yR4pfI0kAArtjJak535+NJrpB0L212PAbXCg0kbyE4SyjFaQ73sMHJLiqAkPb5nGzfC8KvAa3kTADLAEQXyOQ==', 'sec-ch-ua-mobile': '?0', 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.82 Safari/537.36', 'content-type': 'application/x-www-form-urlencoded; charset=UTF-8', 'accept': 'application/json', 'x-requested-with': 'XMLHttpRequest', 'sec-ch-ua-platform': '"Windows"', 'origin': 'https://www.stockrover.com', 'sec-fetch-site': 'same-origin', 'sec-fetch-mode': 'cors', 'sec-fetch-dest': 'empty', 'referer': 'https://www.stockrover.com/research/table/281/s_39/BTU', 'accept-language': 'en-US,en;q=0.9', 'cookie': 'remember_me_pref=0; user_name=test11964; plan=3; premiumBraintreeKey=MIIBCgKCAQEAzM4LJfrNnBOgRFB1dDJkmqTFCWT2Y%2BksOydD8xDH4R033WUzxbffMZb%2B3dqEyQvOVjLcwFIHByDc4Xwej7enas2E%2FVRyh7Cvyadn7M5zQeRyLcI9Ys5KCozMwxJPc0x76FlXPwiAo1Qlz3RcLb9wGHBag2R51FuTie%2BhVDCgzWajqDCREzRhi%2Fqlt3D%2FxXNo%2FiwJlpOUr%2Fx1QnkkILxgKlq1dD7KJ767O5ojYKXsO%2BV2Bfu7sSD3djsOxQJ1%2FRbaDm2E96EDkWhhOeOpPndQ6IuSl4NmnJg%2Fcq6f8csW8M3Ys%2BMZPFkdxPC4%2FfRM1XC9o76PjpVNBIO%2ByJEELKZedwIDAQAB; lr=1644769628; _Ruby2_session=Q1drcmlhazYvUFZLd0NydnRXUGpoUzArZDlxYWRCcW9sRUx5VDBydWVWRHdGWDZlMnlESURzbldwbFV1L0drbUlKaWt5MXRtaS9iR0ZYZEpPVHQ1N25qRnR1d3FrY0tzQW1qQm9CdTZ3MSs0d2c3MlpuMjRiQWhCOHI1cGNWekZ4cUdJd0ZFcGtpeng3MFlqZjFDUW9RYmpFMU9DeGdGMVZKR1EwMjVhSE9yVHl4VXFtQm9aYVBtNHF5d0pwMjJ1aVlNMUVRUzdnVFZWZ1AxQkY5Q0p6a2RKay9QL05tOWk4cHZiSERtaGRxeTlxTWZnV3Q0cjdwR3RndUtmeUp3QThhMnJaV2dGZjlPUUtjcGRidDhiajRxK2g0RUZTMWNZUDBaeGNCcUVxSDJ1QnZVRlRkWk9tUExJNWN3TDN5T1BQcmhVVGsycStVTzJRaUwvSkk2TnNVZldTOGU3Tm5wQ3RUMy9nazFqbzdrUWtvYzRwQWRpV3dnTVB3YzhodFV2U0FRR3VKdllMY01NZmdOdGtmOEJ4UT09LS1nTXBrYldhQ0pEeWJ3ak9qQjcrTGV3PT0%3D--1439f36a7f9362aee4b5b666747a2d63d72e81bd' } response = requests.request("POST", url, headers=headers, data=payload) print(response.json())
The data structure in this case is rather unusual but this looks like it might work for you: import requests url = "https://www.stockrover.com/stock_infos/grid?_dc=1644769629231" payload = "state=%7B%22sortInfo%22%3A%7B%7D%2C%22columns%22%3A%5B77%2C32%2C498%2C500%2C31%2C27%2C499%2C30%2C578%2C28%2C29%2C544%2C181%2C185%2C186%5D%2C%22view%22%3A281%2C%22priorPrimaryColumn%22%3A170%2C%22filterData%22%3A%5B%5D%2C%22name%22%3A%22New%201%22%2C%22cType%22%3A%22Screener%22%2C%22cNode%22%3A%22s_39%22%2C%22cIsFolder%22%3Afalse%2C%22gridSelection%22%3A%22BTU%22%2C%22lastActive%22%3A1396898415%2C%22primaryColumn%22%3A76%2C%22folderDisabledParams%22%3A%7B%22filterData%22%3A%5B%5D%7D%2C%22mainGridDateRange%22%3A%22ytd%22%2C%22groupState%22%3Anull%2C%22moversGridDateRange%22%3A%221_day%22%2C%22peersGridDateRange%22%3A%221_day%22%2C%22lastGridSelections%22%3A%5B%22BTU%22%5D%2C%22lastQuantNode%22%3A%5B%5D%2C%22includeQuotesInTable%22%3Afalse%2C%22includeAllQuotesLastValue%22%3Afalse%2C%22markets%22%3A%7B%22panel%22%3A%22summary%22%7D%2C%22researchPanel%22%3A%22tablePanel%22%2C%22recentSearchTickers%22%3A%5B%22SPY%22%2C%22AMZN%22%2C%22AAPL%22%2C%22s_32%22%2C%22%5ENDX%22%2C%22AXP%22%2C%22XOM%22%2C%22AFL%22%2C%22%5EDJX%22%2C%22AIT%22%2C%22ADVC%22%5D%2C%22quotesBoxTickers%22%3A%5B%22AMZN%22%2C%22AAPL%22%2C%22SPY%22%5D%2C%22checkedQuotesBoxTickers%22%3A%5B%22AMZN%22%2C%22AAPL%22%2C%22SPY%22%5D%2C%22dashboard%22%3A%7B%22buttonRef%22%3A%22272%22%7D%2C%22tickerSelectedFeeds%22%3A%5B%22Benzinga%20News%22%2C%22Yahoo%20News%22%5D%2C%22marketSelectedFeeds%22%3A%5B%22Google%20News%22%2C%22Stock%20Market%20News%20-%20Investing.com%22%5D%2C%22bondsSelectedFeeds%22%3A%5B%22Bonds%20Strategy%20-%20Investing.com%22%5D%2C%22commoditiesSelectedFeeds%22%3A%5B%22Commodities%20%26%20Futures%20News%20-%20Investing.com%22%2C%22Commodities%20Fundamental%20Analysis%20-%20Investing.com%22%2C%22Commodities%20Strategy%20Analysis%20-%20Investing.com%22%5D%2C%22stocksSelectedFeeds%22%3A%5B%22CNNMoney%20News%22%2C%22Google%20News%22%2C%22Seeking%20Alpha%20Top%20Stories%22%5D%2C%22etfsSelectedFeeds%22%3A%5B%22Economy%20News%20-%20Investing.com%22%2C%22ETF%20Analysis%20-%20Investing.com%22%2C%22Investing%20Ideas%20-%20Investing.com%22%5D%2C%22topPanel%22%3A%22researchPanel%22%2C%22maxRecordsNode%22%3Afalse%2C%22version%22%3A7%2C%22lastGridSelectionsRaw%22%3A%5B%22BTU%22%5D%2C%22lastSelectionScreeners%22%3A%22s_39%22%2C%22quotesDisabled%22%3Atrue%2C%22lastSelectionPortfolios%22%3A%22p_2%22%2C%22comparisonPanels%22%3A%7B%22Portfolio%22%3A%22p_2%22%2C%22Index%22%3A%22%5EDJX%22%2C%22Watchlist%22%3A%22Watchlists%22%2C%22Screener%22%3A%22s_39%22%7D%2C%22lastSelectionWatchlists%22%3A%22w_26%22%2C%22indicesSelectedFeeds%22%3A%5B%22Google%20News%22%2C%22Yahoo%20News%22%5D%2C%22newsActive%22%3A%22tickerNews%22%2C%22recentSearchMetrics%22%3A%5B%22Price%22%2C%22EPS%22%2C%22Sales%22%5D%2C%22editPanel%22%3A%22positionsPanel%22%2C%22newsType%22%3A%22marketNews%22%2C%22tableColumns%22%3A%5B%22ticker%22%2C%22rank%22%2C%22score_rank%22%2C%22filter_score%22%2C%22company%22%2C%22cash%22%2C%22currentassets%22%2C%22netppe%22%2C%22intangibles%22%2C%22totalassets%22%2C%22currentliabilities%22%2C%22longtermdebt%22%2C%22totaldebt%22%2C%22totalliabilities%22%2C%22equity%22%2C%22tangiblebookvalue%22%2C%22cash_short_term_p%22%2C%22net_ppe_p%22%2C%22intangibles_p%22%5D%2C%22last_save%22%3A1644769379%2C%22panels%22%3A%7B%22collapsed%22%3A%7B%22chp%22%3Atrue%2C%22ip%22%3Atrue%2C%22mp%22%3Afalse%2C%22qp%22%3Afalse%2C%22conp%22%3Atrue%2C%22fsp%22%3Afalse%7D%2C%22viewportWidth%22%3A%221920%22%2C%22viewportHeight%22%3A%221069%22%2C%22chartPanelHeight%22%3A483%2C%22controlPanelWidth%22%3A296%2C%22insightPanelWidth%22%3A%22485%22%2C%22quoteBoxHeight%22%3A200%2C%22navigationPanelWidth%22%3A277%7D%7D&updateMarket=true&page=1&start=0&limit=250" headers = { 'authority': 'www.stockrover.com', 'sec-ch-ua': '" Not A;Brand";v="99", "Chromium";v="98", "Google Chrome";v="98"', 'x-csrf-token': '7yR4pfI0kAArtjJak535+NJrpB0L212PAbXCg0kbyE4SyjFaQ73sMHJLiqAkPb5nGzfC8KvAa3kTADLAEQXyOQ==', 'sec-ch-ua-mobile': '?0', 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.82 Safari/537.36', 'content-type': 'application/x-www-form-urlencoded; charset=UTF-8', 'accept': 'application/json', 'x-requested-with': 'XMLHttpRequest', 'sec-ch-ua-platform': '"Windows"', 'origin': 'https://www.stockrover.com', 'sec-fetch-site': 'same-origin', 'sec-fetch-mode': 'cors', 'sec-fetch-dest': 'empty', 'referer': 'https://www.stockrover.com/research/table/281/s_39/BTU', 'accept-language': 'en-US,en;q=0.9', 'cookie': 'remember_me_pref=0; user_name=test11964; plan=3; premiumBraintreeKey=MIIBCgKCAQEAzM4LJfrNnBOgRFB1dDJkmqTFCWT2Y%2BksOydD8xDH4R033WUzxbffMZb%2B3dqEyQvOVjLcwFIHByDc4Xwej7enas2E%2FVRyh7Cvyadn7M5zQeRyLcI9Ys5KCozMwxJPc0x76FlXPwiAo1Qlz3RcLb9wGHBag2R51FuTie%2BhVDCgzWajqDCREzRhi%2Fqlt3D%2FxXNo%2FiwJlpOUr%2Fx1QnkkILxgKlq1dD7KJ767O5ojYKXsO%2BV2Bfu7sSD3djsOxQJ1%2FRbaDm2E96EDkWhhOeOpPndQ6IuSl4NmnJg%2Fcq6f8csW8M3Ys%2BMZPFkdxPC4%2FfRM1XC9o76PjpVNBIO%2ByJEELKZedwIDAQAB; lr=1644769628; _Ruby2_session=Q1drcmlhazYvUFZLd0NydnRXUGpoUzArZDlxYWRCcW9sRUx5VDBydWVWRHdGWDZlMnlESURzbldwbFV1L0drbUlKaWt5MXRtaS9iR0ZYZEpPVHQ1N25qRnR1d3FrY0tzQW1qQm9CdTZ3MSs0d2c3MlpuMjRiQWhCOHI1cGNWekZ4cUdJd0ZFcGtpeng3MFlqZjFDUW9RYmpFMU9DeGdGMVZKR1EwMjVhSE9yVHl4VXFtQm9aYVBtNHF5d0pwMjJ1aVlNMUVRUzdnVFZWZ1AxQkY5Q0p6a2RKay9QL05tOWk4cHZiSERtaGRxeTlxTWZnV3Q0cjdwR3RndUtmeUp3QThhMnJaV2dGZjlPUUtjcGRidDhiajRxK2g0RUZTMWNZUDBaeGNCcUVxSDJ1QnZVRlRkWk9tUExJNWN3TDN5T1BQcmhVVGsycStVTzJRaUwvSkk2TnNVZldTOGU3Tm5wQ3RUMy9nazFqbzdrUWtvYzRwQWRpV3dnTVB3YzhodFV2U0FRR3VKdllMY01NZmdOdGtmOEJ4UT09LS1nTXBrYldhQ0pEeWJ3ak9qQjcrTGV3PT0%3D--1439f36a7f9362aee4b5b666747a2d63d72e81bd' } response = requests.request("POST", url, headers=headers, data=payload) stock_info = response.json()['stock_infos'] for info in stock_info: key = info[0] for i, sub in enumerate(info[1:], 1): if sub == key: print(info[i:]) break Output: ['AA', 1452.0, 4285.0, 6679.0, 0.0, 14197.0, 2929.0, 1724.0, 1725.0, 8736.0, 3878.0, 3878.0, 10.23, 47.05, None] ['ACH', 1773.84, 7909.0, 18758.17, 788.41, 30523.38, 9252.6, 8782.1, 14242.28, 18580.33, 9038.55, 8250.17, 5.81, 61.46, 2.58] ...and the values for all observed tickers
Added code and now it's not print correctly to CSV file
I have the first code that is working and printing to csv, however it included a lot of data I didn't need. A paragraph of code was then added to only include the data I wanted. The problem is it prints to the screen correctly but still includes all the data in the CSV file. I've tried everything I could think of in this line but it won't either won't print or still prints everything. data = pd.DataFrame(stock_info) Could someone show me where I'm going wrong so it will print only the portion I want it to? Old Working Code import requests import pandas as pd url = "https://www.stockrover.com/stock_infos/grid?_dc=1644769629231" def stock_data(stock_info): data = pd.DataFrame(stock_info) data.to_csv("data.csv", index=False) payload = "state=%7B%22sortInfo%22%3A%7B%7D%2C%22columns%22%3A%5B77%2C32%2C498%2C500%2C31%2C27%2C499%2C30%2C578%2C28%2C29%2C544%2C181%2C185%2C186%5D%2C%22view%22%3A281%2C%22priorPrimaryColumn%22%3A170%2C%22filterData%22%3A%5B%5D%2C%22name%22%3A%22New%201%22%2C%22cType%22%3A%22Screener%22%2C%22cNode%22%3A%22s_39%22%2C%22cIsFolder%22%3Afalse%2C%22gridSelection%22%3A%22BTU%22%2C%22lastActive%22%3A1396898415%2C%22primaryColumn%22%3A76%2C%22folderDisabledParams%22%3A%7B%22filterData%22%3A%5B%5D%7D%2C%22mainGridDateRange%22%3A%22ytd%22%2C%22groupState%22%3Anull%2C%22moversGridDateRange%22%3A%221_day%22%2C%22peersGridDateRange%22%3A%221_day%22%2C%22lastGridSelections%22%3A%5B%22BTU%22%5D%2C%22lastQuantNode%22%3A%5B%5D%2C%22includeQuotesInTable%22%3Afalse%2C%22includeAllQuotesLastValue%22%3Afalse%2C%22markets%22%3A%7B%22panel%22%3A%22summary%22%7D%2C%22researchPanel%22%3A%22tablePanel%22%2C%22recentSearchTickers%22%3A%5B%22SPY%22%2C%22AMZN%22%2C%22AAPL%22%2C%22s_32%22%2C%22%5ENDX%22%2C%22AXP%22%2C%22XOM%22%2C%22AFL%22%2C%22%5EDJX%22%2C%22AIT%22%2C%22ADVC%22%5D%2C%22quotesBoxTickers%22%3A%5B%22AMZN%22%2C%22AAPL%22%2C%22SPY%22%5D%2C%22checkedQuotesBoxTickers%22%3A%5B%22AMZN%22%2C%22AAPL%22%2C%22SPY%22%5D%2C%22dashboard%22%3A%7B%22buttonRef%22%3A%22272%22%7D%2C%22tickerSelectedFeeds%22%3A%5B%22Benzinga%20News%22%2C%22Yahoo%20News%22%5D%2C%22marketSelectedFeeds%22%3A%5B%22Google%20News%22%2C%22Stock%20Market%20News%20-%20Investing.com%22%5D%2C%22bondsSelectedFeeds%22%3A%5B%22Bonds%20Strategy%20-%20Investing.com%22%5D%2C%22commoditiesSelectedFeeds%22%3A%5B%22Commodities%20%26%20Futures%20News%20-%20Investing.com%22%2C%22Commodities%20Fundamental%20Analysis%20-%20Investing.com%22%2C%22Commodities%20Strategy%20Analysis%20-%20Investing.com%22%5D%2C%22stocksSelectedFeeds%22%3A%5B%22CNNMoney%20News%22%2C%22Google%20News%22%2C%22Seeking%20Alpha%20Top%20Stories%22%5D%2C%22etfsSelectedFeeds%22%3A%5B%22Economy%20News%20-%20Investing.com%22%2C%22ETF%20Analysis%20-%20Investing.com%22%2C%22Investing%20Ideas%20-%20Investing.com%22%5D%2C%22topPanel%22%3A%22researchPanel%22%2C%22maxRecordsNode%22%3Afalse%2C%22version%22%3A7%2C%22lastGridSelectionsRaw%22%3A%5B%22BTU%22%5D%2C%22lastSelectionScreeners%22%3A%22s_39%22%2C%22quotesDisabled%22%3Atrue%2C%22lastSelectionPortfolios%22%3A%22p_2%22%2C%22comparisonPanels%22%3A%7B%22Portfolio%22%3A%22p_2%22%2C%22Index%22%3A%22%5EDJX%22%2C%22Watchlist%22%3A%22Watchlists%22%2C%22Screener%22%3A%22s_39%22%7D%2C%22lastSelectionWatchlists%22%3A%22w_26%22%2C%22indicesSelectedFeeds%22%3A%5B%22Google%20News%22%2C%22Yahoo%20News%22%5D%2C%22newsActive%22%3A%22tickerNews%22%2C%22recentSearchMetrics%22%3A%5B%22Price%22%2C%22EPS%22%2C%22Sales%22%5D%2C%22editPanel%22%3A%22positionsPanel%22%2C%22newsType%22%3A%22marketNews%22%2C%22tableColumns%22%3A%5B%22ticker%22%2C%22rank%22%2C%22score_rank%22%2C%22filter_score%22%2C%22company%22%2C%22cash%22%2C%22currentassets%22%2C%22netppe%22%2C%22intangibles%22%2C%22totalassets%22%2C%22currentliabilities%22%2C%22longtermdebt%22%2C%22totaldebt%22%2C%22totalliabilities%22%2C%22equity%22%2C%22tangiblebookvalue%22%2C%22cash_short_term_p%22%2C%22net_ppe_p%22%2C%22intangibles_p%22%5D%2C%22last_save%22%3A1644769379%2C%22panels%22%3A%7B%22collapsed%22%3A%7B%22chp%22%3Atrue%2C%22ip%22%3Atrue%2C%22mp%22%3Afalse%2C%22qp%22%3Afalse%2C%22conp%22%3Atrue%2C%22fsp%22%3Afalse%7D%2C%22viewportWidth%22%3A%221920%22%2C%22viewportHeight%22%3A%221069%22%2C%22chartPanelHeight%22%3A483%2C%22controlPanelWidth%22%3A296%2C%22insightPanelWidth%22%3A%22485%22%2C%22quoteBoxHeight%22%3A200%2C%22navigationPanelWidth%22%3A277%7D%7D&updateMarket=true&page=1&start=0&limit=250" headers = { 'authority': 'www.stockrover.com', 'sec-ch-ua': '" Not A;Brand";v="99", "Chromium";v="98", "Google Chrome";v="98"', 'x-csrf-token': '7yR4pfI0kAArtjJak535+NJrpB0L212PAbXCg0kbyE4SyjFaQ73sMHJLiqAkPb5nGzfC8KvAa3kTADLAEQXyOQ==', 'sec-ch-ua-mobile': '?0', 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.82 Safari/537.36', 'content-type': 'application/x-www-form-urlencoded; charset=UTF-8', 'accept': 'application/json', 'x-requested-with': 'XMLHttpRequest', 'sec-ch-ua-platform': '"Windows"', 'origin': 'https://www.stockrover.com', 'sec-fetch-site': 'same-origin', 'sec-fetch-mode': 'cors', 'sec-fetch-dest': 'empty', 'referer': 'https://www.stockrover.com/research/table/281/s_39/BTU', 'accept-language': 'en-US,en;q=0.9', 'cookie': 'remember_me_pref=0; user_name=test11964; plan=3; premiumBraintreeKey=MIIBCgKCAQEAzM4LJfrNnBOgRFB1dDJkmqTFCWT2Y%2BksOydD8xDH4R033WUzxbffMZb%2B3dqEyQvOVjLcwFIHByDc4Xwej7enas2E%2FVRyh7Cvyadn7M5zQeRyLcI9Ys5KCozMwxJPc0x76FlXPwiAo1Qlz3RcLb9wGHBag2R51FuTie%2BhVDCgzWajqDCREzRhi%2Fqlt3D%2FxXNo%2FiwJlpOUr%2Fx1QnkkILxgKlq1dD7KJ767O5ojYKXsO%2BV2Bfu7sSD3djsOxQJ1%2FRbaDm2E96EDkWhhOeOpPndQ6IuSl4NmnJg%2Fcq6f8csW8M3Ys%2BMZPFkdxPC4%2FfRM1XC9o76PjpVNBIO%2ByJEELKZedwIDAQAB; lr=1644769628; _Ruby2_session=Q1drcmlhazYvUFZLd0NydnRXUGpoUzArZDlxYWRCcW9sRUx5VDBydWVWRHdGWDZlMnlESURzbldwbFV1L0drbUlKaWt5MXRtaS9iR0ZYZEpPVHQ1N25qRnR1d3FrY0tzQW1qQm9CdTZ3MSs0d2c3MlpuMjRiQWhCOHI1cGNWekZ4cUdJd0ZFcGtpeng3MFlqZjFDUW9RYmpFMU9DeGdGMVZKR1EwMjVhSE9yVHl4VXFtQm9aYVBtNHF5d0pwMjJ1aVlNMUVRUzdnVFZWZ1AxQkY5Q0p6a2RKay9QL05tOWk4cHZiSERtaGRxeTlxTWZnV3Q0cjdwR3RndUtmeUp3QThhMnJaV2dGZjlPUUtjcGRidDhiajRxK2g0RUZTMWNZUDBaeGNCcUVxSDJ1QnZVRlRkWk9tUExJNWN3TDN5T1BQcmhVVGsycStVTzJRaUwvSkk2TnNVZldTOGU3Tm5wQ3RUMy9nazFqbzdrUWtvYzRwQWRpV3dnTVB3YzhodFV2U0FRR3VKdllMY01NZmdOdGtmOEJ4UT09LS1nTXBrYldhQ0pEeWJ3ak9qQjcrTGV3PT0%3D--1439f36a7f9362aee4b5b666747a2d63d72e81bd' } response = requests.request("POST", url, headers=headers, data=payload) stock_info = response.json()['stock_infos'] stock_data(stock_info) New Non-Working Code import requests import pandas as pd url = "https://www.stockrover.com/stock_infos/grid?_dc=1644769629231" def stock_data(stock_info): data = pd.DataFrame(stock_info) data.to_csv("data.csv", index=False) payload = "state=%7B%22sortInfo%22%3A%7B%7D%2C%22columns%22%3A%5B77%2C32%2C498%2C500%2C31%2C27%2C499%2C30%2C578%2C28%2C29%2C544%2C181%2C185%2C186%5D%2C%22view%22%3A281%2C%22priorPrimaryColumn%22%3A170%2C%22filterData%22%3A%5B%5D%2C%22name%22%3A%22New%201%22%2C%22cType%22%3A%22Screener%22%2C%22cNode%22%3A%22s_39%22%2C%22cIsFolder%22%3Afalse%2C%22gridSelection%22%3A%22BTU%22%2C%22lastActive%22%3A1396898415%2C%22primaryColumn%22%3A76%2C%22folderDisabledParams%22%3A%7B%22filterData%22%3A%5B%5D%7D%2C%22mainGridDateRange%22%3A%22ytd%22%2C%22groupState%22%3Anull%2C%22moversGridDateRange%22%3A%221_day%22%2C%22peersGridDateRange%22%3A%221_day%22%2C%22lastGridSelections%22%3A%5B%22BTU%22%5D%2C%22lastQuantNode%22%3A%5B%5D%2C%22includeQuotesInTable%22%3Afalse%2C%22includeAllQuotesLastValue%22%3Afalse%2C%22markets%22%3A%7B%22panel%22%3A%22summary%22%7D%2C%22researchPanel%22%3A%22tablePanel%22%2C%22recentSearchTickers%22%3A%5B%22SPY%22%2C%22AMZN%22%2C%22AAPL%22%2C%22s_32%22%2C%22%5ENDX%22%2C%22AXP%22%2C%22XOM%22%2C%22AFL%22%2C%22%5EDJX%22%2C%22AIT%22%2C%22ADVC%22%5D%2C%22quotesBoxTickers%22%3A%5B%22AMZN%22%2C%22AAPL%22%2C%22SPY%22%5D%2C%22checkedQuotesBoxTickers%22%3A%5B%22AMZN%22%2C%22AAPL%22%2C%22SPY%22%5D%2C%22dashboard%22%3A%7B%22buttonRef%22%3A%22272%22%7D%2C%22tickerSelectedFeeds%22%3A%5B%22Benzinga%20News%22%2C%22Yahoo%20News%22%5D%2C%22marketSelectedFeeds%22%3A%5B%22Google%20News%22%2C%22Stock%20Market%20News%20-%20Investing.com%22%5D%2C%22bondsSelectedFeeds%22%3A%5B%22Bonds%20Strategy%20-%20Investing.com%22%5D%2C%22commoditiesSelectedFeeds%22%3A%5B%22Commodities%20%26%20Futures%20News%20-%20Investing.com%22%2C%22Commodities%20Fundamental%20Analysis%20-%20Investing.com%22%2C%22Commodities%20Strategy%20Analysis%20-%20Investing.com%22%5D%2C%22stocksSelectedFeeds%22%3A%5B%22CNNMoney%20News%22%2C%22Google%20News%22%2C%22Seeking%20Alpha%20Top%20Stories%22%5D%2C%22etfsSelectedFeeds%22%3A%5B%22Economy%20News%20-%20Investing.com%22%2C%22ETF%20Analysis%20-%20Investing.com%22%2C%22Investing%20Ideas%20-%20Investing.com%22%5D%2C%22topPanel%22%3A%22researchPanel%22%2C%22maxRecordsNode%22%3Afalse%2C%22version%22%3A7%2C%22lastGridSelectionsRaw%22%3A%5B%22BTU%22%5D%2C%22lastSelectionScreeners%22%3A%22s_39%22%2C%22quotesDisabled%22%3Atrue%2C%22lastSelectionPortfolios%22%3A%22p_2%22%2C%22comparisonPanels%22%3A%7B%22Portfolio%22%3A%22p_2%22%2C%22Index%22%3A%22%5EDJX%22%2C%22Watchlist%22%3A%22Watchlists%22%2C%22Screener%22%3A%22s_39%22%7D%2C%22lastSelectionWatchlists%22%3A%22w_26%22%2C%22indicesSelectedFeeds%22%3A%5B%22Google%20News%22%2C%22Yahoo%20News%22%5D%2C%22newsActive%22%3A%22tickerNews%22%2C%22recentSearchMetrics%22%3A%5B%22Price%22%2C%22EPS%22%2C%22Sales%22%5D%2C%22editPanel%22%3A%22positionsPanel%22%2C%22newsType%22%3A%22marketNews%22%2C%22tableColumns%22%3A%5B%22ticker%22%2C%22rank%22%2C%22score_rank%22%2C%22filter_score%22%2C%22company%22%2C%22cash%22%2C%22currentassets%22%2C%22netppe%22%2C%22intangibles%22%2C%22totalassets%22%2C%22currentliabilities%22%2C%22longtermdebt%22%2C%22totaldebt%22%2C%22totalliabilities%22%2C%22equity%22%2C%22tangiblebookvalue%22%2C%22cash_short_term_p%22%2C%22net_ppe_p%22%2C%22intangibles_p%22%5D%2C%22last_save%22%3A1644769379%2C%22panels%22%3A%7B%22collapsed%22%3A%7B%22chp%22%3Atrue%2C%22ip%22%3Atrue%2C%22mp%22%3Afalse%2C%22qp%22%3Afalse%2C%22conp%22%3Atrue%2C%22fsp%22%3Afalse%7D%2C%22viewportWidth%22%3A%221920%22%2C%22viewportHeight%22%3A%221069%22%2C%22chartPanelHeight%22%3A483%2C%22controlPanelWidth%22%3A296%2C%22insightPanelWidth%22%3A%22485%22%2C%22quoteBoxHeight%22%3A200%2C%22navigationPanelWidth%22%3A277%7D%7D&updateMarket=true&page=1&start=0&limit=250" headers = { 'authority': 'www.stockrover.com', 'sec-ch-ua': '" Not A;Brand";v="99", "Chromium";v="98", "Google Chrome";v="98"', 'x-csrf-token': '7yR4pfI0kAArtjJak535+NJrpB0L212PAbXCg0kbyE4SyjFaQ73sMHJLiqAkPb5nGzfC8KvAa3kTADLAEQXyOQ==', 'sec-ch-ua-mobile': '?0', 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.82 Safari/537.36', 'content-type': 'application/x-www-form-urlencoded; charset=UTF-8', 'accept': 'application/json', 'x-requested-with': 'XMLHttpRequest', 'sec-ch-ua-platform': '"Windows"', 'origin': 'https://www.stockrover.com', 'sec-fetch-site': 'same-origin', 'sec-fetch-mode': 'cors', 'sec-fetch-dest': 'empty', 'referer': 'https://www.stockrover.com/research/table/281/s_39/BTU', 'accept-language': 'en-US,en;q=0.9', 'cookie': 'remember_me_pref=0; user_name=test11964; plan=3; premiumBraintreeKey=MIIBCgKCAQEAzM4LJfrNnBOgRFB1dDJkmqTFCWT2Y%2BksOydD8xDH4R033WUzxbffMZb%2B3dqEyQvOVjLcwFIHByDc4Xwej7enas2E%2FVRyh7Cvyadn7M5zQeRyLcI9Ys5KCozMwxJPc0x76FlXPwiAo1Qlz3RcLb9wGHBag2R51FuTie%2BhVDCgzWajqDCREzRhi%2Fqlt3D%2FxXNo%2FiwJlpOUr%2Fx1QnkkILxgKlq1dD7KJ767O5ojYKXsO%2BV2Bfu7sSD3djsOxQJ1%2FRbaDm2E96EDkWhhOeOpPndQ6IuSl4NmnJg%2Fcq6f8csW8M3Ys%2BMZPFkdxPC4%2FfRM1XC9o76PjpVNBIO%2ByJEELKZedwIDAQAB; lr=1644769628; _Ruby2_session=Q1drcmlhazYvUFZLd0NydnRXUGpoUzArZDlxYWRCcW9sRUx5VDBydWVWRHdGWDZlMnlESURzbldwbFV1L0drbUlKaWt5MXRtaS9iR0ZYZEpPVHQ1N25qRnR1d3FrY0tzQW1qQm9CdTZ3MSs0d2c3MlpuMjRiQWhCOHI1cGNWekZ4cUdJd0ZFcGtpeng3MFlqZjFDUW9RYmpFMU9DeGdGMVZKR1EwMjVhSE9yVHl4VXFtQm9aYVBtNHF5d0pwMjJ1aVlNMUVRUzdnVFZWZ1AxQkY5Q0p6a2RKay9QL05tOWk4cHZiSERtaGRxeTlxTWZnV3Q0cjdwR3RndUtmeUp3QThhMnJaV2dGZjlPUUtjcGRidDhiajRxK2g0RUZTMWNZUDBaeGNCcUVxSDJ1QnZVRlRkWk9tUExJNWN3TDN5T1BQcmhVVGsycStVTzJRaUwvSkk2TnNVZldTOGU3Tm5wQ3RUMy9nazFqbzdrUWtvYzRwQWRpV3dnTVB3YzhodFV2U0FRR3VKdllMY01NZmdOdGtmOEJ4UT09LS1nTXBrYldhQ0pEeWJ3ak9qQjcrTGV3PT0%3D--1439f36a7f9362aee4b5b666747a2d63d72e81bd' } response = requests.request("POST", url, headers=headers, data=payload) stock_info = response.json()['stock_infos'] stock_data(stock_info) for info in stock_info: key = info[0] for i, sub in enumerate(info[1:], 1): if sub == key: print(info[i:]) break
If you don't need to keep those columns just slice them out by adding a line to your original code: data = pd.DataFrame(stock_info) data = data.iloc[:, 4:] In original code: import requests import pandas as pd url = "https://www.stockrover.com/stock_infos/grid?_dc=1644769629231" def stock_data(stock_info): data = pd.DataFrame(stock_info) data = data.iloc[:, 4:] data.to_csv("data.csv", index=False) payload = "state=%7B%22sortInfo%22%3A%7B%7D%2C%22columns%22%3A%5B77%2C32%2C498%2C500%2C31%2C27%2C499%2C30%2C578%2C28%2C29%2C544%2C181%2C185%2C186%5D%2C%22view%22%3A281%2C%22priorPrimaryColumn%22%3A170%2C%22filterData%22%3A%5B%5D%2C%22name%22%3A%22New%201%22%2C%22cType%22%3A%22Screener%22%2C%22cNode%22%3A%22s_39%22%2C%22cIsFolder%22%3Afalse%2C%22gridSelection%22%3A%22BTU%22%2C%22lastActive%22%3A1396898415%2C%22primaryColumn%22%3A76%2C%22folderDisabledParams%22%3A%7B%22filterData%22%3A%5B%5D%7D%2C%22mainGridDateRange%22%3A%22ytd%22%2C%22groupState%22%3Anull%2C%22moversGridDateRange%22%3A%221_day%22%2C%22peersGridDateRange%22%3A%221_day%22%2C%22lastGridSelections%22%3A%5B%22BTU%22%5D%2C%22lastQuantNode%22%3A%5B%5D%2C%22includeQuotesInTable%22%3Afalse%2C%22includeAllQuotesLastValue%22%3Afalse%2C%22markets%22%3A%7B%22panel%22%3A%22summary%22%7D%2C%22researchPanel%22%3A%22tablePanel%22%2C%22recentSearchTickers%22%3A%5B%22SPY%22%2C%22AMZN%22%2C%22AAPL%22%2C%22s_32%22%2C%22%5ENDX%22%2C%22AXP%22%2C%22XOM%22%2C%22AFL%22%2C%22%5EDJX%22%2C%22AIT%22%2C%22ADVC%22%5D%2C%22quotesBoxTickers%22%3A%5B%22AMZN%22%2C%22AAPL%22%2C%22SPY%22%5D%2C%22checkedQuotesBoxTickers%22%3A%5B%22AMZN%22%2C%22AAPL%22%2C%22SPY%22%5D%2C%22dashboard%22%3A%7B%22buttonRef%22%3A%22272%22%7D%2C%22tickerSelectedFeeds%22%3A%5B%22Benzinga%20News%22%2C%22Yahoo%20News%22%5D%2C%22marketSelectedFeeds%22%3A%5B%22Google%20News%22%2C%22Stock%20Market%20News%20-%20Investing.com%22%5D%2C%22bondsSelectedFeeds%22%3A%5B%22Bonds%20Strategy%20-%20Investing.com%22%5D%2C%22commoditiesSelectedFeeds%22%3A%5B%22Commodities%20%26%20Futures%20News%20-%20Investing.com%22%2C%22Commodities%20Fundamental%20Analysis%20-%20Investing.com%22%2C%22Commodities%20Strategy%20Analysis%20-%20Investing.com%22%5D%2C%22stocksSelectedFeeds%22%3A%5B%22CNNMoney%20News%22%2C%22Google%20News%22%2C%22Seeking%20Alpha%20Top%20Stories%22%5D%2C%22etfsSelectedFeeds%22%3A%5B%22Economy%20News%20-%20Investing.com%22%2C%22ETF%20Analysis%20-%20Investing.com%22%2C%22Investing%20Ideas%20-%20Investing.com%22%5D%2C%22topPanel%22%3A%22researchPanel%22%2C%22maxRecordsNode%22%3Afalse%2C%22version%22%3A7%2C%22lastGridSelectionsRaw%22%3A%5B%22BTU%22%5D%2C%22lastSelectionScreeners%22%3A%22s_39%22%2C%22quotesDisabled%22%3Atrue%2C%22lastSelectionPortfolios%22%3A%22p_2%22%2C%22comparisonPanels%22%3A%7B%22Portfolio%22%3A%22p_2%22%2C%22Index%22%3A%22%5EDJX%22%2C%22Watchlist%22%3A%22Watchlists%22%2C%22Screener%22%3A%22s_39%22%7D%2C%22lastSelectionWatchlists%22%3A%22w_26%22%2C%22indicesSelectedFeeds%22%3A%5B%22Google%20News%22%2C%22Yahoo%20News%22%5D%2C%22newsActive%22%3A%22tickerNews%22%2C%22recentSearchMetrics%22%3A%5B%22Price%22%2C%22EPS%22%2C%22Sales%22%5D%2C%22editPanel%22%3A%22positionsPanel%22%2C%22newsType%22%3A%22marketNews%22%2C%22tableColumns%22%3A%5B%22ticker%22%2C%22rank%22%2C%22score_rank%22%2C%22filter_score%22%2C%22company%22%2C%22cash%22%2C%22currentassets%22%2C%22netppe%22%2C%22intangibles%22%2C%22totalassets%22%2C%22currentliabilities%22%2C%22longtermdebt%22%2C%22totaldebt%22%2C%22totalliabilities%22%2C%22equity%22%2C%22tangiblebookvalue%22%2C%22cash_short_term_p%22%2C%22net_ppe_p%22%2C%22intangibles_p%22%5D%2C%22last_save%22%3A1644769379%2C%22panels%22%3A%7B%22collapsed%22%3A%7B%22chp%22%3Atrue%2C%22ip%22%3Atrue%2C%22mp%22%3Afalse%2C%22qp%22%3Afalse%2C%22conp%22%3Atrue%2C%22fsp%22%3Afalse%7D%2C%22viewportWidth%22%3A%221920%22%2C%22viewportHeight%22%3A%221069%22%2C%22chartPanelHeight%22%3A483%2C%22controlPanelWidth%22%3A296%2C%22insightPanelWidth%22%3A%22485%22%2C%22quoteBoxHeight%22%3A200%2C%22navigationPanelWidth%22%3A277%7D%7D&updateMarket=true&page=1&start=0&limit=250" headers = { 'authority': 'www.stockrover.com', 'sec-ch-ua': '" Not A;Brand";v="99", "Chromium";v="98", "Google Chrome";v="98"', 'x-csrf-token': '7yR4pfI0kAArtjJak535+NJrpB0L212PAbXCg0kbyE4SyjFaQ73sMHJLiqAkPb5nGzfC8KvAa3kTADLAEQXyOQ==', 'sec-ch-ua-mobile': '?0', 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.82 Safari/537.36', 'content-type': 'application/x-www-form-urlencoded; charset=UTF-8', 'accept': 'application/json', 'x-requested-with': 'XMLHttpRequest', 'sec-ch-ua-platform': '"Windows"', 'origin': 'https://www.stockrover.com', 'sec-fetch-site': 'same-origin', 'sec-fetch-mode': 'cors', 'sec-fetch-dest': 'empty', 'referer': 'https://www.stockrover.com/research/table/281/s_39/BTU', 'accept-language': 'en-US,en;q=0.9', 'cookie': 'remember_me_pref=0; user_name=test11964; plan=3; premiumBraintreeKey=MIIBCgKCAQEAzM4LJfrNnBOgRFB1dDJkmqTFCWT2Y%2BksOydD8xDH4R033WUzxbffMZb%2B3dqEyQvOVjLcwFIHByDc4Xwej7enas2E%2FVRyh7Cvyadn7M5zQeRyLcI9Ys5KCozMwxJPc0x76FlXPwiAo1Qlz3RcLb9wGHBag2R51FuTie%2BhVDCgzWajqDCREzRhi%2Fqlt3D%2FxXNo%2FiwJlpOUr%2Fx1QnkkILxgKlq1dD7KJ767O5ojYKXsO%2BV2Bfu7sSD3djsOxQJ1%2FRbaDm2E96EDkWhhOeOpPndQ6IuSl4NmnJg%2Fcq6f8csW8M3Ys%2BMZPFkdxPC4%2FfRM1XC9o76PjpVNBIO%2ByJEELKZedwIDAQAB; lr=1644769628; _Ruby2_session=Q1drcmlhazYvUFZLd0NydnRXUGpoUzArZDlxYWRCcW9sRUx5VDBydWVWRHdGWDZlMnlESURzbldwbFV1L0drbUlKaWt5MXRtaS9iR0ZYZEpPVHQ1N25qRnR1d3FrY0tzQW1qQm9CdTZ3MSs0d2c3MlpuMjRiQWhCOHI1cGNWekZ4cUdJd0ZFcGtpeng3MFlqZjFDUW9RYmpFMU9DeGdGMVZKR1EwMjVhSE9yVHl4VXFtQm9aYVBtNHF5d0pwMjJ1aVlNMUVRUzdnVFZWZ1AxQkY5Q0p6a2RKay9QL05tOWk4cHZiSERtaGRxeTlxTWZnV3Q0cjdwR3RndUtmeUp3QThhMnJaV2dGZjlPUUtjcGRidDhiajRxK2g0RUZTMWNZUDBaeGNCcUVxSDJ1QnZVRlRkWk9tUExJNWN3TDN5T1BQcmhVVGsycStVTzJRaUwvSkk2TnNVZldTOGU3Tm5wQ3RUMy9nazFqbzdrUWtvYzRwQWRpV3dnTVB3YzhodFV2U0FRR3VKdllMY01NZmdOdGtmOEJ4UT09LS1nTXBrYldhQ0pEeWJ3ak9qQjcrTGV3PT0%3D--1439f36a7f9362aee4b5b666747a2d63d72e81bd' } response = requests.request("POST", url, headers=headers, data=payload) stock_info = response.json()['stock_infos'] stock_data(stock_info)
The added block of code is added after the csv file has already been written. You have other problems as well but that is the most obvious at the moment. it should be closer to... ... for info in stock_info: key = info[0] for i, sub in enumerate(info[1:], 1): if sub == key: print(info[i:]) break stock_data(stock_info) Also the added block of code doesn't actually make any changes to the data, it only changes what ends up getting printed. Whatever changes you want made to the file need to be made to stock_info.
Not able to scrape a website, some issue with post request
I am trying to scrape some data from https://tradingtick.com/options/callvsput.php. I have used the header & form-data given in the network tab without much success. Here is my code using python requests library. url = 'https://tradingtick.com/options/callvsput.php' headers = {'Accept': 'application/json, text/plain, */*', 'Accept-Encoding': 'gzip, deflate, br', 'Accept-Language': 'en-US,en;q=0.9,hi;q=0.8', 'Connection': 'keep-alive', 'Content-Length': '134', 'Content-Type': 'application/json;charset=UTF-8', 'DNT': '1', 'Host': 'tradingtick.com', 'Origin': 'https://tradingtick.com', 'Referer': 'https://tradingtick.com/options/callvsput.php', 'sec-ch-ua': '" Not;A Brand";v="99", "Microsoft Edge";v="91", "Chromium";v="91"', 'sec-ch-ua-mobile': '?0', 'Sec-Fetch-Dest': 'empty', 'Sec-Fetch-Mode': 'cors', 'Sec-Fetch-Site': 'same-origin', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36 Edg/91.0.864.64'} payload = { "dataType": "\"hist\"", "endStrike": "\"34800\"", "hDate": "\"2021-07-02\"", "range": "true", "startStrike": "\"34800\"", "type": "\"data\"", "underlying": "\"BANKNIFTY\""} r = requests.post(url, headers=headers, data=payload) OUTPUT: In [72]: r.text Out[72]: '\n' While the response tab on browser shows that it is supposed to return a json object containing data displayed in the chart on the browser. C Could someone please help me by pointing out my mistake ? Thank you !
To get data from server, use json= parameter: import json import requests api_url = "https://tradingtick.com/options/callvsput.php" payload = { "dataType": "hist", "endStrike": "37000", "hDate": "2021-07-02", "range": True, "startStrike": "33000", "type": "data", "underlying": "BANKNIFTY", } data = requests.post(api_url, json=payload).json() # pretty print the data: print(json.dumps(data, indent=4)) Prints: [ "[{\"x\":\"02-07 09:10\",\"y\":\"6704850\",\"type\":\"CE\"},{\"x\":\"02-07 15:30\",\"y\":\"9949875\",\"type\":\"CE\"},{\"x\":\"02-07 09:10\",\"y\":\"4627525\",\"type\":\"PE\"},{\"x\":\"02-07 15:30\",\"y\":\"7585225\",\"type\":\"PE\"}]", "[{\"x\":\"2021-07-02 09:10\",\"y\":\"6704850\",\"type\":\"CE\"},{\"x\":\"2021-07-02 09:15\",\"y\":\"6704850\",\"type\":\"CE\"},{\"x\":\"2021-07-02 09:20\",\"y\":\"7428425\",\"type\":\"CE\"},{\"x\":\"2021-07-02 09:25\",\"y\":\"8827225\",\"type\":\"CE\"},{\"x\":\"2021-07-02 09:30\",\"y\":\"9545125\",\"type\":\"CE\"},{\"x\":\"2021-07-02 09:35\",\"y\":\"9843525\",\"type\":\"CE\"},{\"x\":\"2021-07-02 09:40\",\"y\":\"10247750\",\"type\":\"CE\"},{\"x\":\"2021-07-02 09:45\",\"y\":\"10584800\",\"type\":\"CE\"},{\"x\":\"2021-07-02 09:50\",\"y\":\"10812225\",\"type\":\"CE\"},{\"x\":\"2021-07-02 09:55\",\"y\":\"11055975\",\"type\":\"CE\"},{\"x\":\"2021-07-02 10:00\",\"y\":\"11339575\",\"type\":\"CE\"},{\"x\":\"2021-07-02 10:05\",\"y\":\"11464125\",\"type\":\"CE\"},{\"x\":\"2021-07-02 10:10\",\"y\":\"11660625\",\"type\":\"CE\"},{\"x\":\"2021-07-02 10:15\",\"y\":\"11624000\",\"type\":\"CE\"},{\"x\":\"2021-07-02 10:20\",\"y\":\"11721075\",\"type\":\"CE\"},{\"x\":\"2021-07-02 10:25\",\"y\":\"11738100\",\"type\":\"CE\"},{\"x\":\"2021-07-02 10:30\",\"y\":\"11822750\",\"type\":\"CE\"},{\"x\":\"2021-07-02 10:35\",\"y\":\"11937250\",\"type\":\"CE\"},{\"x\":\"2021-07-02 10:40\",\"y\":\"11875275\",\"type\":\"CE\"},{\"x\":\"2021-07-02 10:45\",\"y\":\"11905750\",\"type\":\"CE\"},{\"x\":\"2021-07-02 10:50\",\"y\":\"12055750\",\"type\":\"CE\"},{\"x\":\"2021-07-02 10:55\",\"y\":\"12181600\",\"type\":\"CE\"},{\"x\":\"2021-07-02 11:00\",\"y\":\"12256325\",\"type\":\"CE\"},{\"x\":\"2021-07-02 11:05\",\"y\":\"12317450\",\"type\":\"CE\"},{\"x\":\"2021-07-02 11:10\",\"y\":\"12355075\",\"type\":\"CE\"},{\"x\":\"2021-07-02 11:15\",\"y\":\"12480125\",\"type\":\"CE\"},{\"x\":\"2021-07-02 11:20\",\"y\":\"12533675\",\"type\":\"CE\"},{\"x\":\"2021-07-02 11:25\",\"y\":\"12496975\",\"type\":\"CE\"},{\"x\":\"2021-07-02 11:30\",\"y\":\"12508850\",\"type\":\"CE\"},{\"x\":\"2021-07-02 11:35\",\"y\":\"12546700\",\"type\":\"CE\"},{\"x\":\"2021-07-02 11:40\",\"y\":\"12453625\",\"type\":\"CE\"},{\"x\":\"2021-07-02 11:45\",\"y\":\"12408600\",\"type\":\"CE\"},{\"x\":\"2021-07-02 11:50\",\"y\":\"12445200\",\"type\":\"CE\"},{\"x\":\"2021-07-02 11:55\",\"y\":\"12473000\",\"type\":\"CE\"},{\"x\":\"2021-07-02 12:00\",\"y\":\"12450550\",\"type\":\"CE\"},{\"x\":\"2021-07-02 12:05\",\"y\":\"12394100\",\"type\":\"CE\"},{\"x\":\"2021-07-02 12:10\",\"y\":\"12301100\",\"type\":\"CE\"},{\"x\":\"2021-07-02 12:15\",\"y\":\"12299025\",\"type\":\"CE\"},{\"x\":\"2021-07-02 12:20\",\"y\":\"12327625\",\"type\":\"CE\"},{\"x\":\"2021-07-02 12:25\",\"y\":\"12296525\",\"type\":\"CE\"},{\"x\":\"2021-07-02 12:30\",\"y\":\"12357550\",\"type\":\"CE\"},{\"x\":\"2021-07-02 12:35\",\"y\":\"12264850\",\"type\":\"CE\"},{\"x\":\"2021-07-02 12:40\",\"y\":\"12358600\",\"type\":\"CE\"},{\"x\":\"2021-07-02 12:45\",\"y\":\"12402250\",\"type\":\"CE\"},{\"x\":\"2021-07-02 12:50\",\"y\":\"12418000\",\"type\":\"CE\"},{\"x\":\"2021-07-02 12:55\",\"y\":\"12429875\",\"type\":\"CE\"},{\"x\":\"2021-07-02 13:00\",\"y\":\"12285275\",\"type\":\"CE\"},{\"x\":\"2021-07-02 13:05\",\"y\":\"11514050\",\"type\":\"CE\"},{\"x\":\"2021-07-02 13:10\",\"y\":\"11464225\",\"type\":\"CE\"},{\"x\":\"2021-07-02 13:15\",\"y\":\"11515700\",\"type\":\"CE\"},{\"x\":\"2021-07-02 13:20\",\"y\":\"11886425\",\"type\":\"CE\"},{\"x\":\"2021-07-02 13:25\",\"y\":\"12082300\",\"type\":\"CE\"},{\"x\":\"2021-07-02 13:30\",\"y\":\"12119650\",\"type\":\"CE\"},{\"x\":\"2021-07-02 13:35\",\"y\":\"12191600\",\"type\":\"CE\"},{\"x\":\"2021-07-02 13:40\",\"y\":\"12256550\",\"type\":\"CE\"},{\"x\":\"2021-07-02 13:45\",\"y\":\"12203225\",\"type\":\"CE\"},{\"x\":\"2021-07-02 13:55\",\"y\":\"12267875\",\"type\":\"CE\"},{\"x\":\"2021-07-02 14:00\",\"y\":\"12321375\",\"type\":\"CE\"},{\"x\":\"2021-07-02 14:05\",\"y\":\"12404150\",\"type\":\"CE\"},{\"x\":\"2021-07-02 14:10\",\"y\":\"12480950\",\"type\":\"CE\"},{\"x\":\"2021-07-02 14:15\",\"y\":\"12460350\",\"type\":\"CE\"},{\"x\":\"2021-07-02 14:20\",\"y\":\"12448800\",\"type\":\"CE\"},{\"x\":\"2021-07-02 14:25\",\"y\":\"12346675\",\"type\":\"CE\"},{\"x\":\"2021-07-02 14:30\",\"y\":\"12308050\",\"type\":\"CE\"},{\"x\":\"2021-07-02 14:35\",\"y\":\"12231425\",\"type\":\"CE\"},{\"x\":\"2021-07-02 14:40\",\"y\":\"12196475\",\"type\":\"CE\"},{\"x\":\"2021-07-02 14:45\",\"y\":\"12134000\",\"type\":\"CE\"},{\"x\":\"2021-07-02 14:50\",\"y\":\"12148500\",\"type\":\"CE\"},{\"x\":\"2021-07-02 14:55\",\"y\":\"12104975\",\"type\":\"CE\"},{\"x\":\"2021-07-02 15:00\",\"y\":\"11983575\",\"type\":\"CE\"},{\"x\":\"2021-07-02 15:05\",\"y\":\"11855825\",\"type\":\"CE\"},{\"x\":\"2021-07-02 15:10\",\"y\":\"11654750\",\"type\":\"CE\"},{\"x\":\"2021-07-02 15:15\",\"y\":\"11509750\",\"type\":\"CE\"},{\"x\":\"2021-07-02 15:20\",\"y\":\"10947325\",\"type\":\"CE\"},{\"x\":\"2021-07-02 15:25\",\"y\":\"10242200\",\"type\":\"CE\"},{\"x\":\"2021-07-02 15:30\",\"y\":\"9949875\",\"type\":\"CE\"},{\"x\":\"2021-07-02 09:10\",\"y\":\"4627525\",\"type\":\"PE\"},{\"x\":\"2021-07-02 09:15\",\"y\":\"4627525\",\"type\":\"PE\"},{\"x\":\"2021-07-02 09:20\",\"y\":\"5146275\",\"type\":\"PE\"},{\"x\":\"2021-07-02 09:25\",\"y\":\"6343150\",\"type\":\"PE\"},{\"x\":\"2021-07-02 09:30\",\"y\":\"6871175\",\"type\":\"PE\"},{\"x\":\"2021-07-02 09:35\",\"y\":\"7231975\",\"type\":\"PE\"},{\"x\":\"2021-07-02 09:40\",\"y\":\"7842050\",\"type\":\"PE\"},{\"x\":\"2021-07-02 09:45\",\"y\":\"8126225\",\"type\":\"PE\"},{\"x\":\"2021-07-02 09:50\",\"y\":\"8282750\",\"type\":\"PE\"},{\"x\":\"2021-07-02 09:55\",\"y\":\"8533500\",\"type\":\"PE\"},{\"x\":\"2021-07-02 10:00\",\"y\":\"8762800\",\"type\":\"PE\"},{\"x\":\"2021-07-02 10:05\",\"y\":\"8932375\",\"type\":\"PE\"},{\"x\":\"2021-07-02 10:10\",\"y\":\"9097025\",\"type\":\"PE\"},{\"x\":\"2021-07-02 10:15\",\"y\":\"9227350\",\"type\":\"PE\"},{\"x\":\"2021-07-02 10:20\",\"y\":\"9223325\",\"type\":\"PE\"},{\"x\":\"2021-07-02 10:25\",\"y\":\"9279675\",\"type\":\"PE\"},{\"x\":\"2021-07-02 10:30\",\"y\":\"9439825\",\"type\":\"PE\"},{\"x\":\"2021-07-02 10:35\",\"y\":\"9592700\",\"type\":\"PE\"},{\"x\":\"2021-07-02 10:40\",\"y\":\"9704525\",\"type\":\"PE\"},{\"x\":\"2021-07-02 10:45\",\"y\":\"9732475\",\"type\":\"PE\"},{\"x\":\"2021-07-02 10:50\",\"y\":\"9624900\",\"type\":\"PE\"},{\"x\":\"2021-07-02 10:55\",\"y\":\"9613400\",\"type\":\"PE\"},{\"x\":\"2021-07-02 11:00\",\"y\":\"9706525\",\"type\":\"PE\"},{\"x\":\"2021-07-02 11:05\",\"y\":\"9722000\",\"type\":\"PE\"},{\"x\":\"2021-07-02 11:10\",\"y\":\"9742975\",\"type\":\"PE\"},{\"x\":\"2021-07-02 11:15\",\"y\":\"9828825\",\"type\":\"PE\"},{\"x\":\"2021-07-02 11:20\",\"y\":\"9831100\",\"type\":\"PE\"},{\"x\":\"2021-07-02 11:25\",\"y\":\"9747400\",\"type\":\"PE\"},{\"x\":\"2021-07-02 11:30\",\"y\":\"9778100\",\"type\":\"PE\"},{\"x\":\"2021-07-02 11:35\",\"y\":\"9774625\",\"type\":\"PE\"},{\"x\":\"2021-07-02 11:40\",\"y\":\"9760975\",\"type\":\"PE\"},{\"x\":\"2021-07-02 11:45\",\"y\":\"9781525\",\"type\":\"PE\"},{\"x\":\"2021-07-02 11:50\",\"y\":\"9793475\",\"type\":\"PE\"},{\"x\":\"2021-07-02 11:55\",\"y\":\"9817825\",\"type\":\"PE\"},{\"x\":\"2021-07-02 12:00\",\"y\":\"9868475\",\"type\":\"PE\"},{\"x\":\"2021-07-02 12:05\",\"y\":\"9931450\",\"type\":\"PE\"},{\"x\":\"2021-07-02 12:10\",\"y\":\"10016575\",\"type\":\"PE\"},{\"x\":\"2021-07-02 12:15\",\"y\":\"10061475\",\"type\":\"PE\"},{\"x\":\"2021-07-02 12:20\",\"y\":\"10086900\",\"type\":\"PE\"},{\"x\":\"2021-07-02 12:25\",\"y\":\"10143900\",\"type\":\"PE\"},{\"x\":\"2021-07-02 12:30\",\"y\":\"10177150\",\"type\":\"PE\"},{\"x\":\"2021-07-02 12:35\",\"y\":\"10260575\",\"type\":\"PE\"},{\"x\":\"2021-07-02 12:40\",\"y\":\"10318175\",\"type\":\"PE\"},{\"x\":\"2021-07-02 12:45\",\"y\":\"10362150\",\"type\":\"PE\"},{\"x\":\"2021-07-02 12:50\",\"y\":\"10451925\",\"type\":\"PE\"},{\"x\":\"2021-07-02 12:55\",\"y\":\"10455500\",\"type\":\"PE\"},{\"x\":\"2021-07-02 13:00\",\"y\":\"10498575\",\"type\":\"PE\"},{\"x\":\"2021-07-02 13:05\",\"y\":\"10551675\",\"type\":\"PE\"},{\"x\":\"2021-07-02 13:10\",\"y\":\"10612375\",\"type\":\"PE\"},{\"x\":\"2021-07-02 13:15\",\"y\":\"10623050\",\"type\":\"PE\"},{\"x\":\"2021-07-02 13:20\",\"y\":\"10714400\",\"type\":\"PE\"},{\"x\":\"2021-07-02 13:25\",\"y\":\"10740825\",\"type\":\"PE\"},{\"x\":\"2021-07-02 13:30\",\"y\":\"10702850\",\"type\":\"PE\"},{\"x\":\"2021-07-02 13:35\",\"y\":\"10688800\",\"type\":\"PE\"},{\"x\":\"2021-07-02 13:40\",\"y\":\"10662700\",\"type\":\"PE\"},{\"x\":\"2021-07-02 13:45\",\"y\":\"10532575\",\"type\":\"PE\"},{\"x\":\"2021-07-02 13:55\",\"y\":\"10395625\",\"type\":\"PE\"},{\"x\":\"2021-07-02 14:00\",\"y\":\"10358725\",\"type\":\"PE\"},{\"x\":\"2021-07-02 14:05\",\"y\":\"10226650\",\"type\":\"PE\"},{\"x\":\"2021-07-02 14:10\",\"y\":\"10135400\",\"type\":\"PE\"},{\"x\":\"2021-07-02 14:15\",\"y\":\"10184600\",\"type\":\"PE\"},{\"x\":\"2021-07-02 14:20\",\"y\":\"10249900\",\"type\":\"PE\"},{\"x\":\"2021-07-02 14:25\",\"y\":\"10159825\",\"type\":\"PE\"},{\"x\":\"2021-07-02 14:30\",\"y\":\"10197025\",\"type\":\"PE\"},{\"x\":\"2021-07-02 14:35\",\"y\":\"10271500\",\"type\":\"PE\"},{\"x\":\"2021-07-02 14:40\",\"y\":\"10214775\",\"type\":\"PE\"},{\"x\":\"2021-07-02 14:45\",\"y\":\"10143575\",\"type\":\"PE\"},{\"x\":\"2021-07-02 14:50\",\"y\":\"10039275\",\"type\":\"PE\"},{\"x\":\"2021-07-02 14:55\",\"y\":\"9860975\",\"type\":\"PE\"},{\"x\":\"2021-07-02 15:00\",\"y\":\"9807250\",\"type\":\"PE\"},{\"x\":\"2021-07-02 15:05\",\"y\":\"9557125\",\"type\":\"PE\"},{\"x\":\"2021-07-02 15:10\",\"y\":\"9286975\",\"type\":\"PE\"},{\"x\":\"2021-07-02 15:15\",\"y\":\"9161000\",\"type\":\"PE\"},{\"x\":\"2021-07-02 15:20\",\"y\":\"8598650\",\"type\":\"PE\"},{\"x\":\"2021-07-02 15:25\",\"y\":\"7964650\",\"type\":\"PE\"},{\"x\":\"2021-07-02 15:30\",\"y\":\"7585225\",\"type\":\"PE\"}]", "Jul 02, 15:30", "08-Jul", "[{\"x\":\"2021-07-02 15:30\",\"y\":\"34971.05\"},{\"x\":\"2021-07-02 09:10\",\"y\":\"34853.05\"},{\"x\":\"2021-07-02 15:25\",\"y\":\"34968.00\"},{\"x\":\"2021-07-02 15:20\",\"y\":\"34943.95\"},{\"x\":\"2021-07-02 15:15\",\"y\":\"34934.95\"},{\"x\":\"2021-07-02 15:10\",\"y\":\"34919.00\"},{\"x\":\"2021-07-02 15:05\",\"y\":\"34934.10\"},{\"x\":\"2021-07-02 15:00\",\"y\":\"34884.25\"},{\"x\":\"2021-07-02 14:55\",\"y\":\"34887.05\"},{\"x\":\"2021-07-02 14:50\",\"y\":\"34904.35\"},{\"x\":\"2021-07-02 14:45\",\"y\":\"34905.15\"},{\"x\":\"2021-07-02 14:40\",\"y\":\"34911.45\"},{\"x\":\"2021-07-02 14:35\",\"y\":\"34950.00\"},{\"x\":\"2021-07-02 14:30\",\"y\":\"34955.00\"},{\"x\":\"2021-07-02 14:25\",\"y\":\"34936.00\"},{\"x\":\"2021-07-02 14:20\",\"y\":\"34841.00\"},{\"x\":\"2021-07-02 14:15\",\"y\":\"34862.00\"},{\"x\":\"2021-07-02 14:10\",\"y\":\"34865.00\"},{\"x\":\"2021-07-02 14:05\",\"y\":\"34812.35\"},{\"x\":\"2021-07-02 14:00\",\"y\":\"34812.65\"},{\"x\":\"2021-07-02 13:55\",\"y\":\"34853.45\"},{\"x\":\"2021-07-02 13:45\",\"y\":\"34919.85\"},{\"x\":\"2021-07-02 13:40\",\"y\":\"34893.55\"},{\"x\":\"2021-07-02 13:35\",\"y\":\"34925.00\"},{\"x\":\"2021-07-02 13:30\",\"y\":\"34940.00\"},{\"x\":\"2021-07-02 13:25\",\"y\":\"34933.85\"},{\"x\":\"2021-07-02 13:20\",\"y\":\"34925.45\"},{\"x\":\"2021-07-02 13:15\",\"y\":\"34989.00\"},{\"x\":\"2021-07-02 13:10\",\"y\":\"35000.50\"},{\"x\":\"2021-07-02 13:05\",\"y\":\"35023.00\"},{\"x\":\"2021-07-02 13:00\",\"y\":\"35023.05\"},{\"x\":\"2021-07-02 12:55\",\"y\":\"34945.20\"},{\"x\":\"2021-07-02 12:50\",\"y\":\"34944.90\"},{\"x\":\"2021-07-02 12:45\",\"y\":\"34944.00\"},{\"x\":\"2021-07-02 12:40\",\"y\":\"34924.70\"},{\"x\":\"2021-07-02 12:35\",\"y\":\"34944.55\"},{\"x\":\"2021-07-02 12:30\",\"y\":\"34938.45\"},{\"x\":\"2021-07-02 12:25\",\"y\":\"34910.55\"},{\"x\":\"2021-07-02 12:20\",\"y\":\"34943.80\"},{\"x\":\"2021-07-02 12:15\",\"y\":\"34910.00\"},{\"x\":\"2021-07-02 12:10\",\"y\":\"34887.00\"},{\"x\":\"2021-07-02 12:05\",\"y\":\"34921.60\"},{\"x\":\"2021-07-02 12:00\",\"y\":\"34883.50\"},{\"x\":\"2021-07-02 11:55\",\"y\":\"34860.00\"},{\"x\":\"2021-07-02 11:50\",\"y\":\"34850.60\"},{\"x\":\"2021-07-02 11:45\",\"y\":\"34871.00\"},{\"x\":\"2021-07-02 11:40\",\"y\":\"34842.45\"},{\"x\":\"2021-07-02 11:35\",\"y\":\"34857.65\"},{\"x\":\"2021-07-02 11:30\",\"y\":\"34863.55\"},{\"x\":\"2021-07-02 11:25\",\"y\":\"34862.85\"},{\"x\":\"2021-07-02 11:20\",\"y\":\"34845.55\"},{\"x\":\"2021-07-02 11:15\",\"y\":\"34845.20\"},{\"x\":\"2021-07-02 11:10\",\"y\":\"34832.10\"},{\"x\":\"2021-07-02 11:05\",\"y\":\"34830.25\"},{\"x\":\"2021-07-02 11:00\",\"y\":\"34828.00\"},{\"x\":\"2021-07-02 10:55\",\"y\":\"34825.00\"},{\"x\":\"2021-07-02 10:50\",\"y\":\"34816.70\"},{\"x\":\"2021-07-02 10:45\",\"y\":\"34852.95\"},{\"x\":\"2021-07-02 10:40\",\"y\":\"34924.35\"},{\"x\":\"2021-07-02 10:35\",\"y\":\"34897.30\"},{\"x\":\"2021-07-02 10:30\",\"y\":\"34923.10\"},{\"x\":\"2021-07-02 10:25\",\"y\":\"34889.90\"},{\"x\":\"2021-07-02 10:20\",\"y\":\"34871.00\"},{\"x\":\"2021-07-02 10:15\",\"y\":\"34906.35\"},{\"x\":\"2021-07-02 10:10\",\"y\":\"34854.05\"},{\"x\":\"2021-07-02 10:05\",\"y\":\"34855.65\"},{\"x\":\"2021-07-02 10:00\",\"y\":\"34847.90\"},{\"x\":\"2021-07-02 09:55\",\"y\":\"34841.30\"},{\"x\":\"2021-07-02 09:50\",\"y\":\"34773.60\"},{\"x\":\"2021-07-02 09:45\",\"y\":\"34820.35\"},{\"x\":\"2021-07-02 09:40\",\"y\":\"34805.00\"},{\"x\":\"2021-07-02 09:35\",\"y\":\"34840.70\"},{\"x\":\"2021-07-02 09:30\",\"y\":\"34812.35\"},{\"x\":\"2021-07-02 09:25\",\"y\":\"34775.65\"},{\"x\":\"2021-07-02 09:20\",\"y\":\"34857.25\"},{\"x\":\"2021-07-02 09:15\",\"y\":\"34868.45\"}]" ]