I'm having trouble displaying content, my program:
#! /usr/bin/python
import urllib
import re
url = "http://yahoo.com"
pattern = '''<span class="medium item-label".*?>(.*)</span>'''
website = urllib.urlopen(url)
pageContent = website.read()
result = re.findall(pattern, pageContent)
for record in result:
print record
output:
Masked teen killed by dad
First look in 'Hotel of Doom'
Ex-NFL QB's sad condition
Reporter ignores warning
Romney's low bar for debates
So the question is what should I include in my code in order to transform ' into characters
adjustment, advance, development, difference, diversity, innovation, modification, reversal, revision, revolution, shift, switch, transformation, transition, variation, turnaround, adjust, alter, diminish, evolve.
Change Ensures That Bad Situations End So long as you embrace change, you will find that your situation does not have to last forever and you will progress on to something bigger and better. If you reject change, experiences and opportunities in your career are likely to pass you by.
Change allows us to move forward in life and experience new and exciting things. When you don't actively work on evolving yourself, life can become stagnant. Learning new skills or working on your inner self can bring about changes you never knew were possible.
Examples of chemical changes are burning, cooking, rusting, and rotting. Examples of physical changes are boiling, melting, freezing, and shredding. Many physical changes are reversible, if sufficient energy is supplied.
The solution for Python 3,
import html
html.unescape(text)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With