I need the help extracted some data from a web site

Discussion in 'PHP' started by georgege, Mar 14, 2009.

  1. #1
    Hi,

    I want to extracted some data from a web site, specifically Cities and Postal Codes.
    Can someone help me how should I do?

    I know that I have used regular expression, but now we urgently need.
    I do not want all the script, just a few ideas what should be written for cities and codes.

    Or a code that does that.

    Thanks in advance,
    george
     
    georgege, Mar 14, 2009 IP
  2. nabil_kadimi

    nabil_kadimi Well-Known Member

    Messages:
    1,065
    Likes Received:
    69
    Best Answers:
    0
    Trophy Points:
    195
    #2
    Maybe file_get_contents() and SimpleXML functions will do the trick
     
    nabil_kadimi, Mar 14, 2009 IP
  3. georgege

    georgege Greenhorn

    Messages:
    99
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    18
    #3
    I do not know how to make simple xml function, if you give a little more.

    So I did: file_get_contents () and I extract all the pages. But now I do not know how to extract data which I need only name city and cod zip. Thanks

    Or one where the regular expression tutorial shows how to extract data from a page.
    Please help me.
    I searched the internet and not found. Thanks

    Best Regards,
    george
     
    georgege, Mar 14, 2009 IP
  4. SmallPotatoes

    SmallPotatoes Peon

    Messages:
    1,321
    Likes Received:
    41
    Best Answers:
    0
    Trophy Points:
    0
    #4
    There isn't a magic general-purpose regular expression that will automatically extract the content you want from any web site.

    You have to look at the HTML source code of the web page, use your brain to see what the patterns are, and then write a regular expression to fit them.
     
    SmallPotatoes, Mar 15, 2009 IP