Answer the question
In order to leave comments, you need to log in
How to set the browser to open with another user?
When someone enters a command, it starts parsing the site, where the second message is what to find. The problem is that when someone enters this command, it is mine that opens with selenium. Can I somehow make the browser open for the one who entered this command? Code below
def zb_forum():
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--disable-extensions')
chrome_options.add_argument('--profile-directory=Default')
chrome_options.add_argument("--incognito")
chrome_options.add_argument("--disable-plugins-discovery");
chrome_options.add_argument("--start-maximized")
chrome_options.add_argument("--disable-blink-features")
chrome_options.add_argument("--disable-blink-features=AutomationControlled")
browser.get('secret')
time.sleep(10)
search_from = browser.find_element_by_tag_name('html')
all_zb = set()
links = browser.find_elements_by_tag_name('a')
content = browser.find_elements_by_css_selector('div.structItem-title')
for element in content:
nick = reseived_message.split()[1]
el = element.text
links =browser.find_element_by_tag_name('a')
if nick in el:
ds = element.find_element_by_partial_link_text(f"{nick}")
ds1 = ds.get_attribute('href')
o = f"{ds.text}\n{ds1}"
write_message(sender,o)
all_zb.add(ds)
write_message(sender,f"Всего жалоб: {len(list(all_zb))}")
for event in longpoll.listen():
if event.type == VkBotEventType.MESSAGE_NEW and event.from_chat and event.message.get('text') !="":
reseived_message = event.message.get('text')
sender = event.chat_id
from_id = event.message.get('from_id')
if reseived_message.split()[0]== '/check':
nick = reseived_message.split()[1]
zb_forum()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question