Answer the question
In order to leave comments, you need to log in
How to get the value from the javascript code of the site?
Hello!
Generally. I don't understand how can I get the value from the div in which the span?
For example, I make a get request to the site and get the source code.
I have this code:
<!DOCTYPE html><html lang="en-US"><head><title>**</title>
...
urnover":87018612238,"turnover24h":13135834196879,"homeNotional24h":131358.3419687911,"foreignNotional24h":1227821955,"prevPrice24h":9456,"vwap":9347.5416,"highPrice":9456.5,"lowPrice":9226,"lastPrice":9393.5,"lastPriceProtected":9394,"lastTickDirection":"MinusTick","lastChangePcnt":-0.0066,"bidPrice":9393.5,"midPrice":9393.75,"askPrice":9394,"impactBidPrice":9393.1993,"impactMidPrice":9393.75,"impactAskPrice":9394.0817,"hasLiquidity":true,"openInterest":618600881,"openValue":6585624979126,"fairMethod":"FundingRate","fairBasisRate":0.1095,"fairBasis":0.11,"fairPrice":9393.17,"markMethod":"FairPrice","markPrice":9393.17,"indicativeTaxRate":0,"indicativeSettlePrice":9393.06,"optionUnderlyingPrice":null,"settledPrice":null,"timestamp":"2020-06-19T11:04:18.600Z"},{"symbol":"XBTM20","rootSymbol":"XBT
...
"lastPrice":111.0
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Net;
namespace Parser
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Начинаю работу.");
string page = "";
WebRequest request = WebRequest.Create("**");
request.Credentials = CredentialCache.DefaultCredentials;
WebResponse response = request.GetResponse();
Console.WriteLine(((HttpWebResponse)response).StatusDescription);
using (Stream dataStream = response.GetResponseStream())
{
StreamReader reader = new StreamReader(dataStream);
string responseFromServer = reader.ReadToEnd();
reader.Close();
page = responseFromServer;
}
response.Close();
}
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question