屏幕刮+登录 [英] screen scrape + login

查看:64
本文介绍了屏幕刮+登录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




你必须做好跟随并且一直在绞尽脑汁

各种解决方案没有那么好的结果。 />

我想使用System.Net.WebClient将数据提交到表单(记录一个

用户),然后重定向到正确的文章。 />

这是一个场景。

如果您没有登录某些文章的网站,那么您将被重定向到一个shtml登录页面。 login.shtml页面发布到

另一个用于身份验证的URL然后让你进入。如果在你必须登录的文章上点击了

,那么你是发送到带有附加网址的

登录页面,
http://www.domainname.com?orq:http:/..._2653091.shtml

我已经尝试将URL客户端请求设置为上面的

登录表单也发布了,但我一直在获取Method Not Allowed。


任何想法?

Hi,

Hi have to do the followign and have been racking my brain with
various solutions that have had no so great results.

I want to use the System.Net.WebClient to submit data to a form (log a
user in) and then redirect to the correct article.

Here is the scenerio.
If you are not logged into the site for certain articles you are
redirected to a shtml login page. The login.shtml page posts to
another url for authentication and then lets you in. If have clicked
on an article that you have to log in to, then you are sent to the
login page with an appeneded URL,
http://www.domainname.com?orq:http:/..._2653091.shtml.
I have tried setting a webclient request to the url that the above
login form posts too, but I keep getting Method Not Allowed.

Any Ideas?

推荐答案

需要更多信息,但这里是典型的登录


1)你请求一个带有webclient的页面

2)您返回一个重定向标题到登录页面。

3)您的代码检测到登录重定向,然后将所需的表单数据发布到

登录页面(手动查看登录页面以获取表单字段需求ired

和方法)。


注意:一个asp.net登录网站要求你实际到达

登录页面以获取有效的viewstate以进行回发。其他系统也可能需要在执行实际发布之前将获取数据删除。


4)登录成功后会返回cookie值您必须在后续请求中发送

,并将重定向标题发送到最初请求的

页面。

- bruce(sqlwork.com)


" n8" < NA ******** @ yahoo.com>在消息中写道

news:6a ************************** @ posting.google.c om ...

|

|

|你必须做跟随并且用

|来绞尽脑汁各种解决方案都没有那么好的结果。

|

|我想使用System.Net.WebClient将数据提交到表单(登录

|用户),然后重定向到正确的文章。

|

|这是场景。

|如果您没有登录某些文章的网站,那么

|重定向到shtml登录页面。 login.shtml页面发布到

|另一个用于身份验证的URL,然后让你进入。如果点击了

|在你必须登录的文章上,然后你被发送到

|带有附加网址的登录页面,

|
http://www.domainname.com?orq:http:/...a_2653091.shtm

l。

|我已经尝试将webclient请求设置为以上

|的URL登录表单也是帖子,但我一直在获取Method Not Allowed。

|

|任何想法?
more info required, but here is typical login

1) you request a page with webclient
2) you are returned a redirect header to the login page.
3) you code detects the login redirect, then post the required form data to
the login page (manually view the login page to get the form fields required
and method).

note: an asp.net login site requires that you actually do a get to the
login page to get valid viewstate to postback. other systems may also
require scaping of the get data to before doing the actual post.

4) a successful post to the login will return a cookie value you must send
on subsequent requests, and a redirect header to the originally requested
page.
-- bruce (sqlwork.com)

"n8" <na********@yahoo.com> wrote in message
news:6a**************************@posting.google.c om...
| Hi,
|
| Hi have to do the followign and have been racking my brain with
| various solutions that have had no so great results.
|
| I want to use the System.Net.WebClient to submit data to a form (log a
| user in) and then redirect to the correct article.
|
| Here is the scenerio.
| If you are not logged into the site for certain articles you are
| redirected to a shtml login page. The login.shtml page posts to
| another url for authentication and then lets you in. If have clicked
| on an article that you have to log in to, then you are sent to the
| login page with an appeneded URL,
|
http://www.domainname.com?orq:http:/...a_2653091.shtm
l.
| I have tried setting a webclient request to the url that the above
| login form posts too, but I keep getting Method Not Allowed.
|
| Any Ideas?


我在这里有一个例子:

http://odetocode.com/Articles/162.aspx


基本上发布到登录表单,取回cookie,然后确保在请求

受保护内容时发送cookie。


-

Scott
http: //www.OdeToCode.com/blogs/scott/

2004年11月24日13:55:23 -0800, na ******** @ yahoo.com (n8)写道:
I have an exampe of this here:

http://odetocode.com/Articles/162.aspx

It''s basically posting to the login form, getting the cookie back, and
then making sure to send the cookie along when requesting the
protected content.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On 24 Nov 2004 13:55:23 -0800, na********@yahoo.com (n8) wrote:


你必须做好跟随并且已经用各种解决方案绞尽脑汁而没有那么好的结果。

我想使用System.Net。 WebClient将数据提交到表单(登录
用户),然后重定向到corre ct文章。

这是一个场景。
如果您没有登录某些文章的网站,您将被重定向到一个shtml登录页面。 login.shtml页面发布到另一个用于身份验证的URL,然后让你进入。如果在你必须登录的文章上点击了
,那么你将被发送到
登录带有附加网址的网页,
http://www.domainname.com?orq:http:/..._2653091.shtml
我试过设置一个webclient请求到上面的网址
登录表单也是帖子,但我一直在不允许使用方法。

任何想法?
Hi,

Hi have to do the followign and have been racking my brain with
various solutions that have had no so great results.

I want to use the System.Net.WebClient to submit data to a form (log a
user in) and then redirect to the correct article.

Here is the scenerio.
If you are not logged into the site for certain articles you are
redirected to a shtml login page. The login.shtml page posts to
another url for authentication and then lets you in. If have clicked
on an article that you have to log in to, then you are sent to the
login page with an appeneded URL,
http://www.domainname.com?orq:http:/..._2653091.shtml.
I have tried setting a webclient request to the url that the above
login form posts too, but I keep getting Method Not Allowed.

Any Ideas?






Scott,

FYI - 这是我读过的关于这个主题的最好的文章之一。

大约6个月前我完全陷入了这个问题并实施了它

使用您在此处提供的概念立即开始。


优秀的工作和解释。

-

Joe Fallon


" Scott Allen" <位掩码@ [NOSPAM] .fred.net>在消息中写道

新闻:av ******************************** @ 4ax.com ...
Scott,
FYI - that was one of the best articles on the subject I ever read.
I was completely stuck on this issue about 6 months ago and I implemented it
straight away using the concepts you presented here.

Excellent work and explanation.
--
Joe Fallon

"Scott Allen" <bitmask@[nospam].fred.net> wrote in message
news:av********************************@4ax.com...
我在这里有一个例子:

http://odetocode.com/Articles/162.aspx

它基本上发布到登录表单,获取cookie,并且<然后确保在请求受保护的内容时发送cookie。

-
Scott
http://www.OdeToCode.com/blogs/scott/

11月24日2004 13:55:23 -0800, na********@yahoo.com (n8 )写道:
I have an exampe of this here:

http://odetocode.com/Articles/162.aspx

It''s basically posting to the login form, getting the cookie back, and
then making sure to send the cookie along when requesting the
protected content.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On 24 Nov 2004 13:55:23 -0800, na********@yahoo.com (n8) wrote:


你必须做跟随并且一直绞尽脑汁
各种解决方案没有那么好结果。

我想使用System.Net.WebClient将数据提交到表单(登录
用户)a然后重定向到正确的文章。

这是一个场景。
如果您没有登录某些文章的网站,您将被重定向到一个shtml登录页面。 login.shtml页面发布到另一个用于身份验证的URL,然后让你进入。如果在你必须登录的文章上点击了
,那么你将被发送到
登录带有附加网址的网页,
http://www.domainname.com?orq:http:/..._2653091.shtml
我试过设置一个webclient请求到上面的网址
登录表单的帖子也一样,但我一直没有得到方法。

任何想法?
Hi,

Hi have to do the followign and have been racking my brain with
various solutions that have had no so great results.

I want to use the System.Net.WebClient to submit data to a form (log a
user in) and then redirect to the correct article.

Here is the scenerio.
If you are not logged into the site for certain articles you are
redirected to a shtml login page. The login.shtml page posts to
another url for authentication and then lets you in. If have clicked
on an article that you have to log in to, then you are sent to the
login page with an appeneded URL,
http://www.domainname.com?orq:http:/..._2653091.shtml.
I have tried setting a webclient request to the url that the above
login form posts too, but I keep getting Method Not Allowed.

Any Ideas?



这篇关于屏幕刮+登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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