Advertisement
Egonau

1

Apr 5th, 2023
725
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.71 KB | None | 0 0
  1. from requests_html import HTMLSession
  2. file = open("photos3.txt", "a")
  3. session = HTMLSession()
  4. url = 'https://fedoseevafoto.ru/disk/19-01-2023-4d-shkola-2030-1/xwykflar'
  5. response = session.get(url, headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 ('
  6.                                                    'KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36'})
  7. response.html.render(sleep=1)
  8. #536
  9. for i in range(1,300):
  10.     st = 'body > div.wrapper > div.project-wrapper > div.grid.pieces.pieces--masonry.grid--medium-pad > ' \
  11.          'div:nth-child({}) > div > a '.format(i)
  12.     titles = response.html.find(st)
  13.     file.write(str(titles[0]).split("'")[-2]+"\n")
  14. file.close()
  15.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement