I want to extract the title and description from the following website:
view-source:http://www.virginaustralia.com/au/en/bookings/flights/make-a-booking/
with the following snippet of source code:
<title>Book a Virgin Australia Flight | Virgin Australia
</title>
<meta name="keywords" content="" />
<meta name="description" content="Search for and book Virgin Australia and partner flights to Australian and international destinations." />
I want the title and meta content.
I used goose but it does not do a good job extracting. Here is my code:
website_title = [g.extract(url).title for url in clean_url_data]
and
website_meta_description=[g.extract(urlw).meta_description for urlw in clean_url_data]
The result is empty
Please check BeautifulSoup as solution.
For question above, you may use the following code to extract "description" info:
output: