Regular acquisition of related problems, solving

Source: Internet
Author: User
Regular acquisition problems, solving, online, etc.
Target page: http://www.weather.com.cn/weather/101070101.shtml

View its web page source code, want 425 rows of data, namely "Today is October 16, 2013 Wednesday lunar September 12" and 621 lines "Shenyang Weather Forecast (2013-10-16 18:00)" and 641 rows ~765 between the main data. In the picture, see:


In addition, I wrote a rule, and tried to take the following data "Shenyang Weather Forecast (2013-10-16
11:00 release) "But after input is an empty array, please guide!" Thanks a lot!

Share to:


------Solution--------------------
1
$s =file_get_contents (' http://www.weather.com.cn/weather/101070101.shtml ');
Preg_match ('/

\s+ (. +) \s+<\!--today5-->/s ', $s, $m);
echo $m [1];



2
Preg_match ('/\s+

\s+ (. +?) \s+/s ', $s, $m);
echo $m [1];



3 don't know what format data you want to get.
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.