Any Python Programmers?

The #1 community for Gun Owners in Indiana

Member Benefits:

  • Fewer Ads!
  • Discuss all aspects of firearm ownership
  • Discuss anti-gun legislation
  • Buy, sell, and trade in the classified section
  • Chat with Local gun shops, ranges, trainers & other businesses
  • Discover free outdoor shooting areas
  • View up to date on firearm-related events
  • Share photos & video with other members
  • ...and so much more!
  • miguel

    Grandmaster
    Rating - 100%
    12   0   0
    Oct 24, 2008
    6,623
    113
    16T
    You trying to scrape an excerpt from a page or the whole page?

    Have you tried the raw_input() function?
     

    Jludo

    Master
    Rating - 100%
    3   0   0
    Feb 14, 2013
    4,164
    48
    Indianapolis
    You trying to scrape an excerpt from a page or the whole page?

    Have you tried the raw_input() function?

    There are ordered lists on the page I want to pull the title text out of, I've got the page parsed I just can't figure out to iterate and export the 'title' names to a list.

    <div class="mobile-columns" style="-moz-column-count:2; -webkit-column-count:2; column-count:2;">
    <h3>
    <span class="mw-headline" id="Alabama">
    Alabama
    </span>
    </h3>
    <ol>
    <li>
    <a href="/Bradley_Byrne" title="Bradley Byrne">
    Bradley Byrne
    </a>
    </li>
    <li>
    <a href="/Gary_Palmer" title="Gary Palmer">
    Gary Palmer
    </a>
    </li>
    <li>
    <a href="/Martha_Roby" title="Martha Roby">
    Martha Roby
    </a>
    </li>
    <li>
     

    JollyMon

    Shooter
    Rating - 100%
    2   0   0
    Sep 27, 2012
    3,547
    63
    Westfield, IN
    you should be able to get a count of the href in a specific span... I think you can use find_all....

    so like

    for a in find_all('a', href=true):
    //find the title attribute and do what you want.
     
    Top Bottom