예제 #1
0
from selenium.webdriver.common.keys import Keys
import time
from selenium.webdriver import ActionChains
from selenium.common.exceptions import NoSuchElementException, ElementNotVisibleException
from seleniumYandex import WebmasterTools, get_massive_from_file

# добавление в важные страницы доменов из файла domain.txt без удаления

## массив доменов domains
domains = get_massive_from_file("work2.txt")

# PROXY = "185.5.17.170:21231" # IP:PORT or HOST:PORT

account_1 = {'login': '******', 'passwd': 'YOUR_PASSWORD'}
account_2 = {'login': '******', 'passwd': 'YOUR_PASSWORD'}

webmasterTools = WebmasterTools(account_2)

# # массив urls
# urls = get_massive_from_file("urlWork.txt")

urls = ["category/korziny-s-tsvetami/"]

webmasterTools.driver.get("https://webmaster.yandex.ru/site/https:avalon.rozarioflowers.ru:443/"
                                                                             "tools/del-url/")

for item in domains:
    try:
        webmasterTools.driver.get("https://webmaster.yandex.ru/site/https:" + item + ".rozarioflowers.ru:443/"
                                                                                     "tools/del-url/")
예제 #2
0
from selenium.webdriver.common.keys import Keys
import time
from selenium.webdriver import ActionChains
from selenium.common.exceptions import NoSuchElementException, ElementNotVisibleException
from seleniumYandex import WebmasterTools, get_massive_from_file

# переобход доменов по urls из файла domainWork.txt в /indexing/reindex/

## массив доменов domains
domains = get_massive_from_file("domainsWork.txt")
## массив urls
# urls = get_massive_from_file("urlWork.txt")

urls = [
    "category/korobki-s-tsvetami", "category/shikarnye-bukety",
    "category/korziny-s-tsvetami", "category/101-roza", ""
]

# PROXY = "185.5.17.170:21231" # IP:PORT or HOST:PORT

account_1 = {'login': '******', 'passwd': 'YOUR_PASSWORD'}
account_2 = {'login': '******', 'passwd': 'YOUR_PASSWORD'}

webmasterTools = WebmasterTools(account_1)

for item in domains:
    try:
        webmasterTools.driver.get("https://webmaster.yandex.ru/site/https:" +
                                  item + ".rozarioflowers.ru:443/"
                                  "indexing/reindex/")
예제 #3
0
from selenium.webdriver.common.keys import Keys
import time
from selenium.webdriver import ActionChains
from selenium.common.exceptions import NoSuchElementException, ElementNotVisibleException, WebDriverException
from seleniumYandex import WebmasterTools, get_massive_from_file
import os

# подтверждение всех проверок в /diagnosis/checklist/#recommendation

# массив доменов domains
domains = get_massive_from_file("/home/dev/PycharmProjects/script-yandex/domainsWork.txt")
# domains = ['abakan']

# PROXY = "185.5.17.170:21231" # IP:PORT or HOST:PORT

account_1 = {'login': '******', 'passwd': 'YOUR_PASSWORD'}
account_2 = {'login': '******', 'passwd': 'YOUR_PASSWORD'}

webmasterTools = WebmasterTools(account_2)
webmasterTools.driver.get("https://webmaster.yandex.ru/site/https:rozarioflowers.ru:443/"
                                                                    "diagnosis/checklist/#recommendation")
webmasterTools.anti_captcha()

for item in domains:
    try:
        webmasterTools.driver.get("https://webmaster.yandex.ru/site/https:" + item + ".rozarioflowers.ru:443/"
                                                                    "diagnosis/checklist/#recommendation")

        buttons = webmasterTools.driver.find_elements_by_xpath("//button[./span[contains(text(), 'Проверить')]]")

        if len(buttons) != 1:
예제 #4
0
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
from selenium.common.exceptions import NoSuchElementException, ElementNotVisibleException
import codecs
from seleniumYandex import WebmasterTools, get_massive_from_file

# добавление сайтов на аккаунт из файла input.txt

# массив доменов domens
domens = get_massive_from_file("domains2acc.txt")

PROXY = "185.5.17.170:21231"  # IP:PORT or HOST:PORT

account_1 = {'login': '******', 'passwd': 'YOUR_PASSWORD'}
account_2 = {'login': '******', 'passwd': 'YOUR_PASSWORD'}

webmasterTools = WebmasterTools(account_1)

code = 'добавлен или уже добавлен'
for item in domens:
    try:
        webmasterTools.driver.get("https://webmaster.yandex.ru/sites/add/")

        webmasterTools.driver.find_element_by_name("hostName").send_keys(
            'https://' + item + '.rozarioflowers.ru')  # url
        time.sleep(1)
        webmasterTools.driver.find_element_by_class_name(
            "one-line-submit__submit").click()  # добавить
        time.sleep(3)