QueryPath Value of Element

Posted on 2012-08-24
Last Modified: 2012-08-29
I'm trying to extract the value of an <li> tag like so:

  <li class="pagenumber ">1</li>

In this case the value is 1. Any ideas?
Question by:kjenney
    LVL 58

    Expert Comment

    Extract it to post in a form submission?
    You will need to use js to get the value and append the querystring.
    But this vaue would be known at page load so you could just place it in a hidden field in the form.

    Explain more...
    LVL 1

    Accepted Solution

    This question is related to QueryPath so I was expecting a QueryPath statement as a solution.

    I figured it out:

    $pagenumber = circqp->branch()->find('li[class="pagenumber"]')->text();                          
    echo $pagenumber."<br>";

    Open in new window

    LVL 1

    Author Closing Comment

    This question is related to QueryPath so I was expecting a QueryPath statement as a solution.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
    Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
    Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now