1 Replies - 469 Views - Last Post: 31 October 2013 - 08:08 AM Rate Topic: -----

#1 bhaktanishant  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 18
  • Joined: 19-November 12

how to extract page-URL using BeautifulSoup

Posted 31 October 2013 - 08:03 AM

I want to extract the page-URL.
Example:
if i have this code

import urllib2
from bs4 import BeautifulSoup
link = "http://www.dreamincode.net"
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.dreamincode.net


Is This A Good Question/Topic? 0
  • +

Replies To: how to extract page-URL using BeautifulSoup

#2 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 9579
  • View blog
  • Posts: 36,298
  • Joined: 12-June 08

Re: how to extract page-URL using BeautifulSoup

Posted 31 October 2013 - 08:08 AM

Do not create duplicate topics. Closing.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1