Tuesday, November 20, 2018

Interesantni Python primeri

https://www.pythonforbeginners.com/basics/list-comprehensions-in-python

https://www.programiz.com/python-programming/closure

https://www.w3schools.com/python/ref_func_map.asp

Game changer for Bots, Scalpers and used in Google Search Bots for retrieving search data from millions of websites for Googles Search Engine Data.
I use it for requesting all CSS, JavaScript and Images once I’ve retrieved the HTML file from a HTTP Request. Bots use it to grab HTML from set list of http or https website paths stored into Lists Arrays.
Yes it retrieves them all using Multi-Threads. They then process all these files to pull out data from SEO meta tags, header tags, site title and possibly the first few paragraphs of each websites main page.
  1. threads = [threading.Thread(target=fetch_url, args=(url,)) for url in cs]
  2. for thread in threads: ;thread.start()
  3. for thread in threads: ;thread.join()
It can be set to retrieve 100 to 200 websites html pages/files and download them all in the same amount of time as a single http request.
My test running “import time time.time()” . How fast is it? For a single website request to fetch all local CSS paths from the HTML Page is under 1.75 combined average time in seconds for Python.org main page with all of its CSS downloaded. Fast Enough for my Mosaic Browser.

No comments:

Post a Comment

Коментар: