none
Getting elements like google chrome Dev Tools. RRS feed

  • Question

  • Hello everyone,

    I've been struggling for a while and decided to create an account here to ask a question. First of all Hi :) Nice to meet you all.

    What I'm looking for is actually quite simple if you think about it, however it's harder than I expected. I want to retrieve a certain data from a (I'm using Httpwebrequest, but everything is welcome). Whenever I do so I don't get the data I want. Lets take this page as an example :

    (can't use hyperlink yet)

    aliexpress.com/item/2015-Gift-10-inch-AllWinner-A33-Quad-Core-Tablet-PC-Android-4-4-OS-wifi-Bluetooth/32325020654.html

    Whenever you do CTRL + U (view page source) You'll see this when searching for "Product description".

     <div class="ui-box product-description-main" id="j-product-description">
            <div class="ui-box-title">Product Description</div>
            <div class="ui-box-body">
    
                <div class="description-content" data-role="description" data-spm="1000023">
                <div class="loading32"></div>
                </div>
    
            </div>
        </div>

    As you can see there's <div class="loading32">. Which is supposed to be loaded if you scroll down. However even if you do scroll down and look up the page source you'll still see loading32 in there.

    Using google chrome dev tools you'll see the proper HTML codes. Text inside the description saying "IMPORTANT NOTICE":

    <span style="margin: 0.0px;padding: 0.0px;border: 0.0px;font-style: inherit;font-weight: inherit;font-size: inherit;line-height: inherit;vertical-align: baseline;background-color: #ffff00;">IMPORTANT NOTICE:</span>

    It does work with the devtools but not with httpwebrequest and or by retrieving webbrowser1.documenttext after the page has been loaded. I've been googling for a while I bet this has been asked before but I really can't seem to find it.

    Any help is much appreciated :)

    Sincerely,

    Samo.

    • Moved by Kristin Xie Friday, January 13, 2017 7:39 AM
    Sunday, January 8, 2017 9:29 PM

All replies

  • Hi _Samo,

    Thank you for posting here.

    According to your question is more related to Google Chrome Developer Tools, you could post a new thread in Google Chrome Developer Tools forum for suitable support.

    The Visual C# discuss and ask the C# programming language, IDE, libraries, samples and tools.

    If you have some grammar or code errors, please feel free to contact us. We will try our best to give you solution.

    Thanks for your understanding and cooperation.

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, January 9, 2017 6:47 AM
  • I think that HtmlWebRequest will give you the initial contents of HTML, but if the page is built by JavaScript, then you need a corresponding engine. The WebBrowser control is able to execute JavaScript. However DocumentText still returns the original source. In order to get the current HTML with JavaScript results, wait until the contents is loaded, then examine this property: webBrowser1.Document.Body.OuterHtml.

    Monday, January 9, 2017 6:59 AM