Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #58268

Re: how to extract page-URL using BeautifulSoup

References <7fb9c035-c663-4874-9597-ac47d1c30da7@googlegroups.com> <VjMcu.4720$J14.740@fx31.am4>
Date 2013-11-01 10:14 -0400
Subject Re: how to extract page-URL using BeautifulSoup
From Joel Goldstick <joel.goldstick@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.1929.1383315259.18130.python-list@python.org> (permalink)

Show all headers | View raw


This is nearly the same question you asked under another name
yesterday.  Its not clear what you really want to do.  You are asking
what the url is of the page you retrieve by providing the same url.

On Fri, Nov 1, 2013 at 7:33 AM, Alister <alister.ware@ntlworld.com> wrote:
> On Thu, 31 Oct 2013 08:59:00 -0700, bhaktanishant wrote:
>
>> I want to extract the page-url. for example:
>> if i have this code
>>
>> import urllib2 from bs4 import BeautifulSoup link =
>> "http://www.google.com"
>> page = urllib2.urlopen(link).read()
>> soup = BeautifulSoup(page)
>>
>> then i can extract title of page by:
>>
>> title = soup.title
>>
>> but i want to know that how to extract page-URL from "soup" that will be
>> "http://www.google.com"
>
> I must be missing something here, the page url is what you use to open
> the page in the first place in your case link.
>
>
>
>
> --
> May a Misguided Platypus lay its Eggs in your Jockey Shorts.
> --
> https://mail.python.org/mailman/listinfo/python-list



-- 
Joel Goldstick
http://joelgoldstick.com

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

how to extract page-URL using BeautifulSoup bhaktanishant@gmail.com - 2013-10-31 08:59 -0700
  Re: how to extract page-URL using BeautifulSoup MRAB <python@mrabarnett.plus.com> - 2013-10-31 17:36 +0000
  Re: how to extract page-URL using BeautifulSoup Alister <alister.ware@ntlworld.com> - 2013-11-01 11:33 +0000
    Re: how to extract page-URL using BeautifulSoup Joel Goldstick <joel.goldstick@gmail.com> - 2013-11-01 10:14 -0400

csiph-web