scrape url out of brackets?

H

homepricemaps

any idea how to scrape a url out of a file? for instance if i want to
scrape out the href at the end which is "www.cnn.com" is there a way to
do it?

<tr class="rulesbody"><td width="183" class="rulesbody"><a
href="www.cnn.com">
 
H

homepricemaps

so you recommend using some sort of for statement with the html parser
where i tell it to only parse stuff found in the <tr> tag for instance?
 
H

homepricemaps

so here is the syntax folks!!!

for anchor in soup.fetch('a', {'target': '_blank'}):
print anchor['href']
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,274
Messages
2,571,373
Members
48,065
Latest member
SusannaSpe

Latest Threads

Top