Can we get web page header information, not body? (To mechanize)

What should I do if I need to load only a page if it has not changed since the last load? What is the best way? I can get the page size first, and then compare the solution, has it changed, if so, will I ask you to download another skip?

I plan to use (python) mechanization.

+3
source share
2 answers

the request should be HEAD , not GET:

9.4 HEAD

HEAD GET , . , HTTP HEAD GET. . , .

HEAD - , , . , ( Content-Length, Content-MD5, ETag Last-Modified), .

. HEAD ?

+5

, python,

br = mechanize.Browser()
br.set_debug_http(True)
br.set_debug_redirects(True)
... Your code here ...

,

0

Source: https://habr.com/ru/post/1743207/


All Articles