View Single Post
  #26  
Old 14.01.2021, 12:52
sharkboy sharkboy is offline
Banned
 
Join Date: Apr 2020
Posts: 171
Default

The application has a function for viewing images from Yandex images via webbrowser and downloading the selected one. I got the link like this:
Code:
1
urlImage = HD.DocumentNode.SelectSingleNode("//a[@class='MMButton MMButton_type_link MMViewerButtons-OpenImage MMViewerButtons-OpenImage_isOtherSizesEnabled']").GetAttributeValue("href", "");
Recently they have made changes to the code and now the data is loaded dynamically. The href attribute now contains "#", so the data cannot be downloaded.
Thought cefsharp would help, but it returns "#" too. Moreover, if you open the developer tools in the same chrome, the link to the image is displayed in the desired class. So, is it possible, through webbrowser or cefsharp, to get me to return the source code of the page with the already existing link to the picture?

The ways

Code:
var jsResponse = await chromeBrowser.EvaluateScriptAsync(@"document.getElementsByTagName ('html')[0].innerHTML");
            if (jsResponse.Success)
            {
                string source = jsResponse.Result.ToString();
            }
and

Code:
var source = await chromeBrowser.GetSourceAsync();
return the variant with "#" in the desired class, not with a reference.
Reply With Quote