Google News
logo
Jsoup - Quiz(MCQ)

Jsoup : jsoup is an open-source Java library designed to parse, extract, and manipulate data stored in HTML documents.

jsoup was created in 2009 by Jonathan Hedley. It is distributed it under the MIT License, a permissive free software license similar to the Creative Commons attribution license.

A)
Yes
B)
No
C)
Can Not Say
D)
None of the above

Correct Answer :   Yes


Explanation : Jsoup is an open-source project.

A)
Java modular
B)
Java compiler
C)
Java library
D)
None of the above

Correct Answer :   Java library

A)
2013
B)
2009
C)
2007
D)
2000

Correct Answer :   2009


Explanation : jsoup was created in 2009 by Jonathan Hedley.

A)
James Mandy
B)
Adam Abrons
C)
Alex Washington
D)
Jonathan Hedley

Correct Answer :   Jonathan Hedley


Explanation : jsoup was created in 2009 by Jonathan Hedley. It is distributed it under the MIT License, a permissive free software license similar to the Creative Commons attribution license.

5 .
Which of the following method is used in Jsoup to parse an HTML or XML document from a string, file, or URL?
A)
Parse()
B)
Parsing()
C)
Parse_all()
D)
Parse_HTML()

Correct Answer :   Parse()


Explaination : To parse an HTML or XML document from a string, file, or URL, use the parse() method.

A)
Parse()
B)
ParseFragments()
C)
parseBodyFragment(String html)
D)
None of the above

Correct Answer :   parseBodyFragment(String html)


Explanation : parseBodyFragment(String html) is a method for parsing an HTML document fragment.

A)
Get(int index)
B)
Extract(index)
C)
Retrieve(index)
D)
None of the above

Correct Answer :   Get(int index)


Explanation : get(int, index) method returns an element at a given index from a collection of HTML elements.

A)
Child()
B)
Children()
C)
Get_child()
D)
Parent_children()

Correct Answer :   Children()


Explanation : Children() method returns the child components of an HTML element.

A)
One()
B)
First()
C)
Foremost()
D)
None of the above

Correct Answer :   First()


Explanation : First() method is used to retrieve the first element from a set of HTML elements.

A)
Html()
B)
Get()
C)
Get_HTML()
D)
Return_html()

Correct Answer :   Html()


Explanation : html() method returns the HTML content of an HTML element.

A)
FTP
B)
XML
C)
LTT
D)
HTML

Correct Answer :   HTML


Explanation : jsoup is a Java library for working with real-world HTML. It provides a very convenient API for fetching URLs and extracting and manipulating data, using the best of HTML5 DOM methods and CSS selectors.

jsoup implements the WHATWG HTML5 specification, and parses HTML to the same DOM as modern browsers do.

A)
API
B)
JSI
C)
output
D)
None of the above

Correct Answer :   API


Explanation : jsoup provides a very convenient API for fetching URLs and extracting and manipulating data.

A)
Attribute()
B)
Html_attribute()
C)
Attr()
D)
None of the above

Correct Answer :   Attr()


Explanation : attr() function is used to obtain or set the value of an HTML element's attribute.

A)
Clean()
B)
Select()
C)
Append()
D)
None of the above

Correct Answer :   Select()


Explanation : Select() method is used to find elements in a document that matches a CSS-style selector.

A)
C
B)
C++
C)
Java
D)
Python

Correct Answer :   Java


Explanation : Jsoup is written in Java.

A)
Will connect with the URL.
B)
Will returns the title of the object
C)
will return the reference document object
D)
All of the above

Correct Answer :   Will connect with the URL.


Explanation : The Jsoup.connect() method, Will connect with the URL.

17 .
Jsoup api contains how many packages that provide classes and interfaces for creating jsoup applications?
A)
3
B)
4
C)
5
D)
6

Correct Answer :   6


Explaination : Jsoup api contains six packages that provide classes and interfaces for creating jsoup applications :

* org.jsoup
* org.jsoup.examples
* org.jsoup.helper
* org.jsoup.nodes
* org.jsoup.parser
* org.jsoup.safety
* org.jsoup.salect

A)
1
B)
2
C)
3
D)
4

Correct Answer :   2


Explanation : There are two ways to install jsoup :

* By maven pom.xml
* By jsoup.jar file.

A)
Jsoup
B)
Element
C)
Document
D)
All of the above

Correct Answer :   All of the above


Explanation : The main classes of Jsoup API :

* Jsoup
* Document
* Element

A)
Del()
B)
Delete()
C)
Clear()
D)
Remove()

Correct Answer :   Clear()


Explanation : To delete an HTML element from a document, use the clear() method.

A)
Jtidy
B)
TagSoup
C)
HTMLUnit
D)
All of the above

Correct Answer :   All of the above


Explanation : Following are the alternatives of Jsoup :

* HTMLUnit
* Jtidy
* TagSoup

A)
Text()
B)
Content()
C)
Text_content()
D)
None of the above

Correct Answer :   Text()


Explanation : The text() method is employed to get an element's text content.

A)
IBM
B)
Netflix
C)
Mozilla
D)
All of the above

Correct Answer :   All of the above


Explanation : Following companies are using Jsoup:

* IBM
* Netflix
* Mozilla

A)
200
B)
2010
C)
2012
D)
2013

Correct Answer :   2010


Explanation : jsoup 1.1.1 released in 8 Jun, 2010

A)
Node
B)
Hoop
C)
Element
D)
None of the above

Correct Answer :   Element


Explanation : The main classes of jsoup api are given below :

* Jsoup
* Document
* Element

A)
links
B)
hosts
C)
methods
D)
None of the above

Correct Answer :   methods


Explanation : The org.jsoup.Jsoup class provides methods to connect, clean and parse the HTML document.