none
webBrowser Search for a sentence in the html RRS feed

  • Question

  • this code html static but ID It changes every time

    <div dir="LTR" style="height:100%;width:100%;direction:ltr" ID="P5157ce92048c4b96a04fdf20fd6f6bc9_1_oReportDiv">

    webBrowser1

    How

    string ID =???

    Saturday, November 16, 2019 6:59 PM

All replies

  • searching an element without an id requires reverse engineering the web site e.g. is this div always the third div after an element with a fixed id or inside table cell which the column having the same header each time? That is a lot of guess work even with the full html of various variations of the page (page structure can change in unexpected times, e.g. when your password is about to expire an alert may change the page layout). As reverse engineering prone to web redesign don't even bother if it has continuous delivery. By the time you figure out a pattern the pattern may already be changed to something else. A much better way is to contact the web server and see if there is stable API. 


    Visual C++ MVP

    Saturday, November 16, 2019 8:37 PM
  • Hi AL3ANEED, 

    Thank you for posting here.

    According to your description, I have some questions to confirm with you.

    What’s the type of your application?

    Could you provide more details about your problem and some related code here? It will help us to analyze you problem and make a test.

    We are waiting for your update.

    Best Regards,

    Xingyu Zhao


    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.

    Friday, November 29, 2019 8:00 AM
    Moderator