如何读取从网站的响应? [英] how to read the response from a web site?

查看:100
本文介绍了如何读取从网站的响应?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网站的网址而通过采取压缩code作为输入参数,给出了相应的城市名称。现在我想知道如何阅读从网站的响应。

I have a website url which gives corresponding city names by taking zip code as input parameter. Now I want to know how to read the response from the site.

这是我使用的链接 http://zipinfo.com/cgi - 本地/ zipsrch.exe?邮编= 60680

推荐答案

您将不得不使用HttpWebRequest对象连接到该网站,并刮去从响应的信息。

You'll have to Use the HTTPWebRequest object to connect to the site and scrape the information from the response.

查找HTML标签或类名的包装,你正在努力寻找的内容,然后使用正则表达式或字符串函数来获取所需的数据。

Look for html tags or class names that wrap the content you are trying to find, then use either regexes or string functions to get the required data.

很好的例子这里

这篇关于如何读取从网站的响应?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆