0

I am trying to extract the section of government bill data, such as this https://www.govtrack.us/data/congress/113/bills/sconres/sconres14/text-versions/is/document.xml. I only want the text from the section, but can't figure how how to navigate to it using python's xml.etree.ElementTree; the equivalent javascript would be something like getElementbyTagName.

1 Answer 1

1

In xml.etree.ElementTree, you can use findall() passing XPath expression string as parameter, to find elements with certain criteria. So, for simple element names (those that doesn't contain prefix), the equivalent of Javascript's getElementbyTagName("elementName") in ElementTree would be findall(".//tagName").

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.