[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
- <!--x-content-type: text/plain -->
- <!--x-date: Fri Jun 10 08:38:47 2005 -->
- <!--x-from-r13: syrgpu ng culqrnhk.bet (Tyrgpu) -->
- <!--x-message-id: [email protected] -->
- <!--x-reference: [email protected] -->
- <!--x-reference: [email protected] --> "http://www.w3.org/TR/html4/loose.dtd">
- <!--x-subject: [ale] Opening a webpage with a password? -->
- <li><em>date</em>: Fri Jun 10 08:38:47 2005</li>
- <li><em>from</em>: fletch at phydeaux.org (Fletch)</li>
- <li><em>in-reply-to</em>: <<a href="msg00442.html">[email protected]</a>> (Christopher Bergeron's message of "Thu, 09 Jun 2005 23:48:52 -0400")</li>
- <li><em>references</em>: <<a href="msg00441.html">[email protected]</a>> <<a href="msg00442.html">[email protected]</a>></li> Christopher> Rob - it depends on the type of authentication used Christopher> on the site. Older sites (aka one's that displayed Christopher> the browsers' native authentication popup), could be Christopher> accessed using the uid at pw URL combo that you Christopher> described. Newer sites, however, use different Christopher> authentication methods - so your code won't work.
- <li><em>subject</em>: [ale] Opening a webpage with a password?</li>
I wouldn't necessarily categorize either as "newer" or "older". The
type that works using the browser popup is using authentication at the
HTTP layer; the other scheme is to handle it in the application layer
using cookies or some other form session id (e.g. something embedded
in the URL). Both have been around for ages; however handling it in
the application has advantages (for instance being able to offer a way
for the user to logout, since pretty much Opera's the only browser
that offers a way to discard HTTP auth credentials short of quitting
the browser) and is the way most people tend do things nowdays.
As for automating it, you basically will have to submit (POST) the
filled in login page form to the browser and accept any cookies that
sends back and then send those same cookies along when you try to
access a protected page. Perl (of course :) has the WWW::Mechanize
module which sits on top of LWP and provides support for this type of
thing. If you're doing any heavy spidering Mechanize already knows
how to do a bunch of the gruntwork you'd have to reimplement
yourself.
<a rel="nofollow" href="http://search.cpan.org/~petdance/WWW-Mechanize-1.12/lib/WWW/Mechanize.pm">http://search.cpan.org/~petdance/WWW-Mechanize-1.12/lib/WWW/Mechanize.pm</a>
--
Fletch | "If you find my answers frightening, __`'/|
fletch at phydeaux.org| Vincent, you should cease askin' \ o.O'
| scary questions." -- Jules =(___)=
| U
</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<!--X-Follow-Ups-End-->
<!--X-References-->
<ul><li><strong>References</strong>:
<ul>
<li><strong><a name="00441" href="msg00441.html">[ale] Opening a webpage with a password?</a></strong>
<ul><li><em>From:</em> Robert.L.Harris at rdlg.net (Robert L. Harris)</li></ul></li>
<li><strong><a name="00442" href="msg00442.html">[ale] Opening a webpage with a password?</a></strong>
<ul><li><em>From:</em> christopher at bergeron.com (Christopher Bergeron)</li></ul></li>
</ul></li></ul>
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg00448.html">[ale] User training</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg00450.html">[ale] RE: suse 9.2 yast2 - printer media source setting - Solved</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg00442.html">[ale] Opening a webpage with a password?</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg00443.html">[ale] Opening a webpage with a password?</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#00449"><strong>Date</strong></a></li>
<li><a href="threads.html#00449"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>
<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>