top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What does use of BeautifulSoup module in Python?

+1 vote
403 views
What does use of BeautifulSoup module in Python?
posted Nov 19, 2014 by Amit Kumar Pandey

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

BeautifulSoup is a python library which make it very easy to parse html or xml files.

Typically , when you have a xml file, you would want to parse it in a few way like
- Getting all child elements tags
- Getting children at nth level
- Getting parent element of a XML tag

Beautiful soup offers a very well defined and intuitive API to do all this and more.

answer Dec 2, 2014 by Shyam Purkayastha
Similar Questions
0 votes

The type() builtin according to python docs, returns a "type object".
http://docs.python.org/2/library/types.html

And in this module is bunch of what I assume are "type objects". Is this correct?
http://docs.python.org/2/library/functions.html#type

And type(), aside from being used in as an alternative to a class statement to create a new type, really just returns the object class, doesn't it?

>>> import types
>>> a = type(1)
>>> b = (1).__class__
>>> c = int
>>> d = types.IntType
>>> a is b is c is d
True
>>> 

If type() didn't exist would it be much more of a matter than the following?:

def type(x): 
 return x.__class__

What is the purpose of type()?
What exactly is a "type object"? Is it a "class"?
What is the purpose of the types module?

I understand the purpose of isinstance and why it's recommended over something like (type(1) is int). Because isinstance will also return True if the object is an instance of a subclass.

>>> class xint(int):
 def __init__(self):
 pass

>>> x = xint()
>>> type(x) is int
False
>>> isinstance(x, int)
True
>>> 
+1 vote

I read the online help about string. It lists string constants, string formatting, template strings and string functions. After reading these, I am still puzzled about how to use the string module.

Could you show me a few example about this module?

0 votes

I am trying to make an HTTPS connection and read that HTTPS support is only available if the socket module was compiled with SSL support.

http://www.jython.org/docs/library/httplib.html

Can someone elaborate on this? Where can I get the socket module for HTTPS, or how do I build one if I have to?

+1 vote

Recently, I have been studying OpenCV to detect and recognize faces using C++. In order to execute source code demonstration from the OpenCV website I need to run Python to crop image first. Unfortunately, the message error is ImportError: No module named Image when I run the Python script ( this script is provided by OpenCV website). I installed python-2.7.amd64 and downloaded PIL-1.1.7.win32-py2.7 to install Image library. However, the message error is Python version 2.7 required, which was not found in the registry. And then, I downloaded the script written by Joakim Löw for Secret Labs AB / PythonWare to register registry in my computer. But the message error is "Unable to register. You probably have the another Python installation".

Please help

...