Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import selenium
- from selenium.common.exceptions import NoSuchElementException
- import time
- import json
- import re
- from selenium import webdriver
- import bs4
- from urllib.request import urlopen as uReq
- from bs4 import BeautifulSoup as soup
- import json
- url = "https://www.instagram.com/p/Bz0cp0dgA4L/"
- driver = webdriver.Chrome('/Users/wjtho/Downloads/chromedriver')
- driver.get(url)
- #Banner: Not Logged IN: Button to get rid of the did not login button
- driver.implicitly_wait(40)
- driver.find_element_by_class_name('dCJp8.afkep.xqRnw._0mzm-').click()
- %%time
- err = 0
- i = 1
- while (err == 0):
- try:
- button = driver.find_element_by_class_name('Igw0E.IwRSH.YBx95._4EzTm.MGdpg.NUiEW')
- button.click()
- print(i)
- i += 1
- except NoSuchElementException:
- err += 1
- i += 1
- err
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement