• 17-01-2025, 16:40:06
    #10
    Üyeliği durduruldu
    Selenium ile yapılabilir ama her bir site için Class şeklinde XPath ve Agent tanımı yazmak gerekir.
  • 17-01-2025, 16:51:18
    #11
    fatbotter.com
    Çok rahatlıkla yapılabilir, firma sitelerinin kayıt sayfasındaki değişiklikler botta patlamaya sebep olacaktır ancak onarması kolay olur. Mail onayı gerektiren siteler de var, burada tek sıkıntı mail onay linkine de tıklamayı gerektirmesi. Python ile tam bir otomasyon yapılabilir.

    Dinamik güzel bir yapı hazırlanırsa yeni site eklemek de oldukça kolay olur.

    Önerim, her sitenin form inputları ve xpath adreslerinin bulunduğu bir yapılandırma dosyası hazırlanması.

    Aşağıda 5 farklı firma rehberi için demo bir yapılandırma dosyası örneği ekledim. Python betik de bu yapılandırma dosyasındaki sitelere verilecek firma bilgileriyle üyelik oluşturabilir. Eğer istenirse mail onayı gerektiren siteler için de maile gidip onay linkine tıklayabilir. Zaman alıcı bir iş, kendiniz öğrenirseniz daha mantıklı.

    {
      "sites": {
        "firmaturk": {
          "url": "https://www.firmaturk.com/firma-ekle",
          "fields": [
            {
              "xpath": "//input[@id='company_name']",
              "data_key": "name",
              "type": "text",
              "required": true
            },
            {
              "xpath": "//select[@id='business_category']",
              "data_key": "category",
              "type": "select",
              "required": true
            },
            {
              "xpath": "//textarea[@id='company_description']",
              "data_key": "description",
              "type": "textarea",
              "required": false
            },
            {
              "xpath": "//input[@id='phone']",
              "data_key": "phone",
              "type": "text",
              "required": true
            },
            {
              "xpath": "//input[@id='email']",
              "data_key": "email",
              "type": "email",
              "required": true
            },
            {
              "xpath": "//input[@name='terms']",
              "type": "checkbox",
              "value": true,
              "required": true
            }
          ],
          "submit_button": "//button[@type='submit']",
          "success_indicator": "//div[contains(@class,'success-message')]"
        },
        "rehberim": {
          "url": "https://www.rehberim.com/yeni-kayit",
          "pre_actions": [
            {
              "type": "click",
              "xpath": "//button[contains(text(),'Ücretsiz Kayıt')]"
            }
          ],
          "fields": [
            {
              "xpath": "//input[@name='firma_adi']",
              "data_key": "name",
              "type": "text"
            },
            {
              "xpath": "//input[@name='yetkili']",
              "data_key": "contact_person",
              "type": "text"
            },
            {
              "xpath": "//select[@name='il']",
              "data_key": "city",
              "type": "select",
              "wait_for_options": true
            },
            {
              "xpath": "//select[@name='ilce']",
              "data_key": "district",
              "type": "select",
              "depends_on": "il"
            },
            {
              "xpath": "//input[@type='file']",
              "data_key": "logo",
              "type": "file",
              "optional": true
            }
          ],
          "submit_button": "//input[@type='submit']"
        },
        "isletmeci": {
          "url": "https://www.isletmeci.net/firma-kayit",
          "fields": [
            {
              "xpath": "//input[@name='company']",
              "data_key": "name",
              "type": "text"
            },
            {
              "xpath": "//div[contains(@class,'editor')]//iframe",
              "data_key": "description",
              "type": "rich_text"
            },
            {
              "xpath": "//input[@name='address']",
              "data_key": "address",
              "type": "text"
            },
            {
              "xpath": "//input[@name='website']",
              "data_key": "website",
              "type": "url",
              "optional": true
            },
            {
              "xpath": "//input[@name='social_media[]']",
              "data_key": "social_media",
              "type": "multiple_text"
            }
          ],
          "submit_button": "//button[contains(@class,'submit-btn')]",
          "captcha": {
            "type": "recaptcha",
            "xpath": "//div[@class='g-recaptcha']"
          }
        },
        "ticarethane": {
          "url": "https://www.ticarethane.com/firma-ekle",
          "login_required": true,
          "login": {
            "url": "https://www.ticarethane.com/giris",
            "username_field": "//input[@name='username']",
            "password_field": "//input[@name='password']",
            "submit_button": "//button[@type='submit']"
          },
          "fields": [
            {
              "xpath": "//input[@name='title']",
              "data_key": "name",
              "type": "text"
            },
            {
              "xpath": "//input[@name='tax_number']",
              "data_key": "tax_number",
              "type": "text"
            },
            {
              "xpath": "//input[@name='tax_office']",
              "data_key": "tax_office",
              "type": "text"
            },
            {
              "xpath": "//select[@name='working_hours[]']",
              "data_key": "working_hours",
              "type": "multiple_select"
            },
            {
              "xpath": "//input[@name='keywords']",
              "data_key": "keywords",
              "type": "tags"
            }
          ],
          "submit_button": "//button[@id='saveCompany']"
        },
        "sektorel": {
          "url": "https://www.sektorel.com/firma-kaydi",
          "fields": [
            {
              "xpath": "//input[@id='company_name']",
              "data_key": "name",
              "type": "text"
            },
            {
              "xpath": "//select[@name='business_type']",
              "data_key": "business_type",
              "type": "select",
              "options": {
                "1": "Üretici",
                "2": "Toptancı",
                "3": "Perakendeci",
                "4": "Hizmet"
              }
            },
            {
              "xpath": "//input[@name='founded_year']",
              "data_key": "founded_year",
              "type": "number",
              "validation": {
                "min": 1900,
                "max": 2024
              }
            },
            {
              "xpath": "//input[@name='employee_count']",
              "data_key": "employee_count",
              "type": "radio",
              "options": {
                "1-10": "//input[@value='1-10']",
                "11-50": "//input[@value='11-50']",
                "51-200": "//input[@value='51-200']",
                "201+": "//input[@value='201+']"
              }
            },
            {
              "xpath": "//input[@name='location']",
              "data_key": "location",
              "type": "map",
              "requires_coordinates": true
            }
          ],
          "submit_button": "//button[contains(@class,'submit')]",
          "success_page": "/firma-kaydi-basarili"
        }
      },
      "global_settings": {
        "timeout": 30,
        "retry_attempts": 3,
        "delay_between_sites": 5,
        "screenshot_on_error": true,
        "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
      }
    }