Đoàn Minh Tâm 13 Đã viết 19/12/2020 Chào mọi người. Mọi người ai biết Request pagesource html trang Lazada hàng loạt mà không bị check point. Vui lòng hướng dẫn giúp mình. Mình dùng Webclient để request sync page. Code demo: string url = "https://www.lazada.vn/products/dien-thoai-samsung-galaxy-s20-plus-128gb8gb-hang-chinh-hang-moi-100-nguyen-seal-bao-hanh-12-thang-i498830724-s974814141.html?spm=a2o4n.searchlist.list.8.706b3a0fcsJ4Oe&search=1"; Uri address = new Uri(url); WebClient webClient = new WebClient(); webClient.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded"; //< get Website > //*here: download as string webClient.DownloadStringCompleted += WebClient_DownloadStringCompleted; webClient.DownloadStringAsync(address); private void WebClient_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e) { //-------------------< WebClient_DownloadStringCompleted() >------------------- //< check > if (e.Error != null) { var output = e.Error.Message; } //</ check > else if (e.Result != null) { richTextBox1.Invoke(new MethodInvoker(delegate () { richTextBox1.Text = e.Result; })); //var document = new HtmlDocument(); //document.LoadHtml(e.Result); //var node = document.DocumentNode.SelectSingleNode("//span[@id=\"result_box\"]"); //var output = node != null ? node.InnerText : e.Error.Message; } //-------------------</ WebClient_DownloadStringCompleted() >------------------- } Trích dẫn Chia sẻ bài đăng này Link tới bài viết Share on other sites
Chào mọi người.
Mọi người ai biết Request pagesource html trang Lazada hàng loạt mà không bị check point. Vui lòng hướng dẫn giúp mình.
Mình dùng Webclient để request sync page.
Code demo:
Chia sẻ bài đăng này
Link tới bài viết
Share on other sites