Note that there are some explanatory texts on larger screens.

plurals
  1. POmatweb.com: How to get source of page?
    primarykey
    data
    text
    <p>I have url like:<br> <a href="http://www.matweb.com/search/DataSheet.aspx?MatGUID=849e2916ab1541be9ff6a17b78f95c82" rel="nofollow">http://www.matweb.com/search/DataSheet.aspx?MatGUID=849e2916ab1541be9ff6a17b78f95c82</a></p> <p>I want to download source code from that page using this code:</p> <pre><code>private static string urlTemplate = @"http://www.matweb.com/search/DataSheet.aspx?MatGUID="; static string GetSource(string guid) { try { Uri url = new Uri(urlTemplate + guid); HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(url); webRequest.Method = "GET"; HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse(); Stream responseStream = webResponse.GetResponseStream(); StreamReader responseStreamReader = new StreamReader(responseStream); String result = responseStreamReader.ReadToEnd(); return result; } catch (Exception ex) { return null; } } </code></pre> <p>When I do so I get:</p> <blockquote> <p>You do not seem to have cookies enabled. MatWeb Requires cookies to be enabled.</p> </blockquote> <p>Ok, that I understand, so I added lines:</p> <pre><code>CookieContainer cc = new CookieContainer(); webRequest.CookieContainer = cc; </code></pre> <p>I got:</p> <blockquote> <p>Your IP Address has been restricted due to excessive use. The problem may be compounded when an IP address may be shared by many people in a company or through an internet service provider. We apologize for any inconvenience.</p> </blockquote> <p>I can understand this but I'm not getting this message when I try to visit this page using web browser. What can I do to get the source code? Some cookies or http headers?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload