Hands-On Web Scraping with Python by Anish Chapagain
Author:Anish Chapagain
Language: eng
Format: epub, mobi
Tags: COM018000 - COMPUTERS / Data Processing, COM004000 - COMPUTERS / Intelligence (AI) and Semantics, COM021030 - COMPUTERS / Databases / Data Mining
Publisher: Packt Publishing
Published: 2019-06-14T06:10:57+00:00
print(list(soup.find('p','story').contents))
['Once upon a time there were three little sisters; and their names were\n', <a class="sister" href="http://example.com/elsie" id="link1">Elsie</a>, ',\n', <a class="sister" href="http://example.com/lacie" id="link2">Lacie</a>, ' and\n', <a class="sister" href="http://example.com/tillie" id="link3">Tillie</a>, ';\nand they lived at the bottom of a well.']
print(list(soup.find('p','story').descendants))
['Once upon a time there were three little sisters; and their names were\n', <a class="sister" href="http://example.com/elsie" id="link1">Elsie</a>, 'Elsie', ',\n', <a class="sister" href="http://example.com/lacie" id="link2">Lacie</a>, 'Lacie', ' and\n', <a class="sister" href="http://example.com/tillie" id="link3">Tillie</a>, 'Tillie', ';\nand they lived at the bottom of a well.']
Selected children and descendants tag names can be obtained using the name attribute. Parsed strings and the \n function (newline) are returned as None, which can be filtered out, as in the following code:
#using List Comprehension Technique
print([a.name for a in soup.find('p','story').children])
[None, 'a', None, 'a', None, 'a', None]
Download
Hands-On Web Scraping with Python by Anish Chapagain.mobi
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Computer Vision & Pattern Recognition | Expert Systems |
Intelligence & Semantics | Machine Theory |
Natural Language Processing | Neural Networks |
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8295)
Test-Driven Development with Java by Alan Mellor(6696)
Data Augmentation with Python by Duc Haba(6600)
Principles of Data Fabric by Sonia Mezzetta(6358)
Learn Blender Simulations the Right Way by Stephen Pearson(6249)
Microservices with Spring Boot 3 and Spring Cloud by Magnus Larsson(6116)
Hadoop in Practice by Alex Holmes(5958)
Jquery UI in Action : Master the concepts Of Jquery UI: A Step By Step Approach by ANMOL GOYAL(5806)
RPA Solution Architect's Handbook by Sachin Sahgal(5516)
Big Data Analysis with Python by Ivan Marin(5346)
The Infinite Retina by Robert Scoble Irena Cronin(5216)
Life 3.0: Being Human in the Age of Artificial Intelligence by Tegmark Max(5143)
Pretrain Vision and Large Language Models in Python by Emily Webber(4305)
Infrastructure as Code for Beginners by Russ McKendrick(4068)
Functional Programming in JavaScript by Mantyla Dan(4037)
The Age of Surveillance Capitalism by Shoshana Zuboff(3946)
WordPress Plugin Development Cookbook by Yannick Lefebvre(3783)
Embracing Microservices Design by Ovais Mehboob Ahmed Khan Nabil Siddiqui and Timothy Oleson(3584)
Applied Machine Learning for Healthcare and Life Sciences Using AWS by Ujjwal Ratan(3562)
