Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7093847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:29:26+00:00 2026-05-28T08:29:26+00:00

This is a sample query I might do in PHP: foreach(steps as step) {

  • 0

This is a sample query I might do in PHP:

foreach(steps as step)
{
  areT_eles = xpath->query(t_eleQuery, step)
}

Now in python:

for step in index steps:
  areT_eles = ?!?!?!?!!??!?!!??!!

I tried this:

for step in index steps:
  areT_eles = xpath.query(t_eleQuery, step)

It didn’t work. I’ve only imported Elementtree from xml.etree.ElementTree, though.

The most official page I was able to find on xpath in elementtree actually didn’t have any documentation or examples…. And we all know how horribly bad Python official’s tutorials are. So, I’m also looking for a good resource.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T08:29:26+00:00Added an answer on May 28, 2026 at 8:29 am

    If you have LXML, the high-performance, full-featured version of ElementTree, installed you can use XPath as follows:

    >>> from lxml import etree
    >>> xml = """<ham><spam>Hello!</spam> <spam>Goodbye!</spam></ham>"""
    >>> tree.xpath("//spam/text()")
    ['Hello!', 'Goodbye!']
    

    I can recommend LXML for all your Python XML needs; it’s fast and Pythonic.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This might be a very simple thing. Check out the normal sql query below
If this is possible, please provide a sample query or two so I can
I have this query: SELECT * FROM sample INNER JOIN test ON sample.sample_number =
this might a simple query. when we are creating a thread we are passing
I've been stuck with this simple Sql query for last 3 hours and my
I've got a reasonably simple query (this time) that I need ALL the results
I have a simple query like this: select * from mytable where id >
Maybe a very simple question. How can I put in this code <Query> <Where>
Imagine this sample java class: class A { void addListener(Listener obj); void removeListener(Listener obj);
Consider this sample code: <div class=containter id=ControlGroupDiv> <input onbeforeupdate=alert('bingo 0'); return false; onclick=alert('click 0');return

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.