Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Apr 2007
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to get values from a url's div class variable

    How to get values from a url's div class variable:

    for example:

    if we want temperature value of Chicago IL from cnn.com/weather the url is:

    http://weather.cnn.com/weather/forec...&zipCode=60601

    and under this url there is a div class variable:
    cnnWeatherTempCurrent

    this variable contains the value of the current temperature.

    so using HTML or Javascript or PHP how can we get the value of this variable in our web page

    Your help is highly appreciated.

  • #2
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    Are you asking how to scrape data from another site? Google +scrape +website to become familiar.

  • #3
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    You should be able to do it with file_get_contents(), and preg_match().

  • #4
    Senior Coder
    Join Date
    Mar 2003
    Location
    Atlanta
    Posts
    1,037
    Thanks
    14
    Thanked 30 Times in 28 Posts
    Are you just looking for a weather script?
    http://www.codingforums.com/showthread.php?t=79468
    Most of my questions/posts are fairly straightforward and simple. I post long verbose messages in an attempt to be thorough.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •