Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Extract div block from HTML using xPath or QM string functions
#1
<!DOCTYPE html>
Code:
Copy      Help
<html>
    <head>
        <title>Page Title</title>
    </head>
    <body>
        <div class="title"> <---------------------------------------------------- EXTRACT BEGIN
            <a href="https://www.download/book.pdf" target="_blank">
                Book title
            </a>
            <div class="js-subproduct-admin-edit" data-entity-kind="subproduct" data-machine-name="booktitle_1"></div>
        </div> <---------------------------------------------------- EXTRACT END
        </div class="some_other_block">
            test
        </div>            
    </body>
</html>

Is it possible using xPath in QM to extract div block:  <div class="title">  , see arrows above
Or can it be done using QM string/regex functions?
I have some attempts but they are ugly not efficient solutions.

I can do it using Acc functions of QM but I want to do it without using Acc, if possible.
I searched "xPath on html" -> https://www.google.com/search?client=fir...th+on+html
But attempting it QM, I get errors.


Messages In This Thread
Extract div block from HTML using xPath or QM string functions - by r0n - 03-01-2022, 10:02 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)