比如我想从:http://weather.news.sina.com.cn/
取出想要的城市的天气信息,然后存成一个文本文件,只要后天的晴天和温度的
我只想要这几个城市的
http://php.weather.sina.com.cn/search.php?city=呼和浩特
http://php.weather.sina.com.cn/search.php?city=拉萨
http://php.weather.sina.com.cn/search.php?city=北京
http://php.weather.sina.com.cn/search.php?city=香港想得到的:后天北京和香港是晴的,拉萨和呼和浩特不是晴天txt文件:
北京 晴 12/21℃
香港 晴 28/32℃
请问应该怎么做??谢谢给位高手,能否给出代码,要是可以对我来说省了很多事情

解决方案 »

  1.   

    工程--部件 --选中  Microsoft Internet Controls  关闭 使用这个WebBrowser控件
      

  2.   

    Dim doc As IHTMLDocument2
    Dim strTmp as String
        
    Set doc = WebBrowser1.DocumentstrTmp = doc.body.innerHTML然后从字符串中提取相应的内容.不用我全部写出来吧?那样等于是我在写了,而不是你自己.另外
    http://weather.news.sina.com.cn/text/index.shtml
    这个页面有全部信息,而且是文本表格形式的,更容易处理.请参考以下代码
    Dim Tables As IHTMLElementCollection
       Set Tables = WebBrowser2.document.getElementsByTagName("TABLE")  '循环出TagName为TABLE的表格元素
        Dim Table1 As HTMLTable
        For Each Table1 In Tables
             Dim Row As HTMLTableRow, Cell As HTMLTableCell
              For i = 1 To Table1.rows.length - 1      ' 逐行处理
                Set Row = Table1.rows(i)          
                Row.cells(j).innerText                 '读取指定列的内容
              Next
        Next