What are some examples of options for HTML scraping?
from __future__ import with_statement
import re, os
profile = ""
os.system("wget --no-cookies --header "Cookie: soba=(SeCreTCODe)" http://stackoverflow.com/users/30/myProfile.html")
with open("myProfile.html") as f:
for line in f:
profile = profile + line
f.close()
p = re.compile("summarycount">(d+)</div>") #Rep is found here
print p
m = p.search(profile)
print m
print m.group(1)
os.system("espeak "Rep is at " + m.group(1) + " points""
os.remove("myProfile.html")
Tags: html html-parsing html-content-extraction web-scraping
Source: By Mark Harrison as answer to the question
This code snippet was collected from stackoverflow, and is licensed under CC BY-SA 4.0
Related code-snippets:
- Why did the width collapse in the percentage width child element in Internet Explorer 7?
- Which timezone is most important?
- Multiple submit buttons in HTML form.
- How can I print an HTML document from a web service?
- How do I know which font has been used in Web page?
- How to break word after special character like Hyphens (-)?
- What are some ways to get matches using preg_replace in PHP?
- How do I make a checkbox toggle from clicking on the text label as well?
- How do you disable browser autocomplete on web form field?
- What is a wrapper for lists in columns?
- Is there a way to change the height of a div in HTML or CSS?
- How do you set up a CSS switcher to run your website in a browser?
- HTML Comments Markup Markup.
- How do HTML comments break down into parts?
- Regular expression for parsing web pages?