Please find answers below:
1. Python Request Module
Python Request Module is basically a module using which you can
send all kinds of HTTP/HTTPS requests. Using the module we can pass
parameters in the request URL, send custom headers, do SSL
verification. It can be used to send XML or JSON or any custom raw
request and receive the response from the server application.
Response from server application can be in any format, either HTML,
XML, JSON or any custom format.
2.
What is JSON ?
JSON stands for JavaScript Object Notation. Its a light weight
format for storing and sending data. As JSON is light weight than
traditional web services (SOAP) it takes less bandwidth and hence
much faster to transport from one server to another or server to
any client.
Comparison between JSON and CSV:
a. JSON support hierarchical data which is not supported by
CSV
b. You don't need to write custom parsers for parsing JSON but if
we add one more column you will have make changes in parser program
which is an overhead.
3.
What is HTML DOM ?
The DOM is a W3C standard for accessing documents (HTML or XML).
HTML DOM is a object model and programming interface for HTML. The
standard defines HTML elements as objects, properties of HTML
elements, methods to access elements and event for elements. In
simple words HTML DOM is guidelines on how to get, change, add or
delete HTML elements.
4.
Get element by ID: dom.getElementById("elementID");
Get element by Class name:
dom.getElementsByClassName("class_name")
Get element by Name: dom.getElementsByName("name")
Get element by Tag Name: dom.getElementsByTagName("tag_name")
5. Regular expression is a string of text that helps to create a pattern which then help match and find text.
6.
Python Subprocess: The module enable a programmer to start new
applications for a python program. Sub process can be by using
Popen function call. Sub processes modules allow us to spawn
processes using which we can execute multiple processes at same
time.
Start sub process in python:
#!/usr/bin/env python
from subprocess import Popen, PIPE
myprocess = Popen(['cat', 'program.py'], stdout=PIPE,
stderr=PIPE)
stdout, stderr = myprocess.communicate()
print stdout
process.communicate() call reads input and output from the
process.
subprocess.call() is used to start program
6.
CSV: CSV stands for Comma Separated Values files which is a
plain text file containing list of data separated by delimiter lime
comma, semicolon, pipe, etc
CSV doesn't support hierarchical data which is supported by
XML.
CSV is much light weighted that XML and should be used when data
size is very big.
Custom parsers are required to parse CSV which is not required in
XML.
7. HTTP conversation is between client and server wherein client
sends a GET or POST request, servers processes the request from
client and send the response to client.
Difference between GET and POST
a. Parameters are sent as part of URL in case of GET and hence can
be viewed as part of browser history.
b. GET is less secure than POST
c. GET should NOT be used for sending sensitive data.
Please help as much as you can it’s pretty much just terms What is the main purpose of the python-requests module? What kinds of requests can it make, and what types of responses might be returne...
please use python and provide run result, thank you! click on pic to make it bigger For this assignment you will have to investigate the use of the Python random library's random generator function, random.randrange(stop), randrange produces a random integer in the range of 0 to stop-1. You will need to import random at the top of your program. You can find this in the text or using the online resources given in the lectures A Slot Machine Simulation Understand...
Please read the article and answer about questions. You and the Law Business and law are inseparable. For B-Money, the two predictably merged when he was negotiat- ing a deal for his tracks. At other times, the merger is unpredictable, like when your business faces an unexpected auto accident, product recall, or government regulation change. In either type of situation, when business owners know the law, they can better protect themselves and sometimes even avoid the problems completely. This chapter...