On 8 mar, 20:49, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> I have a large file that has many lines like this,
>
> name="DoseReferenceStructureType">SITE
>
> I would like to identify the line by the tag (300a,0014) and then grab
> the name (DoseReferenceStructureType) and value (SITE).
It's
On Mar 8, 2:02 pm, Nemesis <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > I have a large file that has many lines like this,
>
> > > name="DoseReferenceStructureType">SITE
>
> > I would like to identify the line by the tag (300a,0014) and then grab
> > the name (DoseReferenceStructureTy
[EMAIL PROTECTED] wrote:
> I have a large file that has many lines like this,
>
> name="DoseReferenceStructureType">SITE
>
> I would like to identify the line by the tag (300a,0014) and then grab
> the name (DoseReferenceStructureType) and value (SITE).
>
> I would like to create a file that woul
Hey Brian,
It seems the text you are trying to parse is similar to XML/HTML.
So I'd use BeautifulSoup[1] if I were you :)
here's a sample code for your scraping case:
from BeautifulSoup import BeautifulSoup
# assume the s variable has your text
s = "whatever xml or html here"
# turn it into a