Advertisement
doubledare704

Untitled

Apr 17th, 2019
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import aiohttp
  2. import asyncio
  3.  
  4.  
  5. async def fetch(session, url):
  6.     async with session.get(url) as response:
  7.         return await response.text()
  8.  
  9.  
  10. async def main():
  11.     async with aiohttp.ClientSession() as session:
  12.         url_list = ["https://www.ukr.net/", "https://ukr.segodnya.ua/", "https://korrespondent.net/"]
  13.         sites_has_googleads = []
  14.         for u in url_list:
  15.             html = await fetch(session, u)
  16.             # print(html)
  17.             print("googletagservices" in html)
  18.             if "googletagservices" in html:
  19.                 sites_has_googleads.append(u)
  20.        
  21.         print(f"These {sites_has_googleads} contain googletagservices script")
  22.  
  23.  
  24. if __name__ == '__main__':
  25.     loop = asyncio.get_event_loop()
  26.     loop.run_until_complete(main())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement