0

im looking how to find .mp4 code on the website.

When i use just this code :

string urlAddress = "https://narutoboruto.wbijam.pl/odtwarzacz-mxlRnPah_UK_LdVDHkN4ShzC0iAgUSZeZxx.html";

HttpWebRequest request = (HttpWebRequest)WebRequest.Create(urlAddress);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();

if (response.StatusCode == HttpStatusCode.OK)
{
  Stream receiveStream = response.GetResponseStream();
  StreamReader readStream = null;

  if (String.IsNullOrWhiteSpace(response.CharacterSet))
     readStream = new StreamReader(receiveStream);
  else
     readStream = new StreamReader(receiveStream, Encoding.GetEncoding(response.CharacterSet));

  string data = readStream.ReadToEnd();

  response.Close();
  readStream.Close();
  
  Console.WriteLine(data);

}

I get source of the page but i don't see there .mp4 link . When i just do it manually in chrome i see link .mp4 Example shows : enter image description here

What do i need to do to get this link? What am i doing wrong here? Please show some example how can i get this data.

No Name Pro
  • 160
  • 1
  • 7
Adam Zbudniewek
  • 107
  • 2
  • 12

1 Answers1

0

You can't scrape this page without loading the scripts

It appears that this page loads in the mp4 URL with a separate piece of JavaScript. Because you're just getting the raw HTML of the page, no loading of scripts is done and the URL you're looking for is never added to the page.

In order to scrape this page (which legally, you probably shouldn't) you would likely need to run a headless browser instance that would load the scripts and allow you to get the URL.

AlpacaFur
  • 194
  • 2
  • 12
  • Do you have any example how can i do that? – Adam Zbudniewek Aug 25 '20 at 18:06
  • Take a look at [this post](https://stackoverflow.com/questions/10161413/headless-browser-for-c-sharp-net) to look into headless browsers for c#. How to use those particular ones is beyond my knowledge, so I would recommend either reading the documentation or finding a guide on the internet once you choose one. – AlpacaFur Aug 25 '20 at 18:16