I'm currently trying to parse a webpage to get a certain string:
<script type="text/javascript" src="./interceptor/resource/org.apache.wicket.resource.JQueryResourceReference/jquery/jquery-3.4.1-ver-220AFD743D9E9643852E31A135A9F3AE.js?requestSecurityToken=610f15bd-0e23-4ac5-90c3-c0829ad8024e"></script>
This is the code I came up with to load the web page:
using (HttpClient http = new HttpClient())
{
var response = await http.GetStringAsync(pagelink);
Console.WriteLine(response);
HtmlDocument pageDocument = new HtmlDocument();
pageDocument.LoadHtml(response);
var token = pageDocument.DocumentNode.SelectSingleNode("").InnerText;
Console.WriteLine(token);
}
The issue is that I need to get from the string that I mentioned earlier only the token: 610f15bd-0e23-4ac5-90c3-c0829ad8024e
I guess there should be a method to do it, but I can't succeed even with Xpath. So I was wondering if there were any way to parse it from framed string for example:
left string: requestSecurityToken=
right string: ></script>