네이버 로그인

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;

public class Exam02 {
	public static void main(String[] args)  throws Exception {
		System.setProperty("webdriver.chrome.driver", "chromedriver.exe");

		WebDriver driver = new ChromeDriver();
		driver.get("https://nid.naver.com/nidlogin.login?mode=form&url=https%3A%2F%2Fwww.naver.com");//
		
		driver.findElement(By.id("id")).sendKeys("ABCD");
		driver.findElement(By.id("pw")).sendKeys("password");
		
//		driver.findElement(By.id("log.login")).click(); // 네이버에서 아이피밴 받을 수도있다. + 네이버에선 자동화툴 차단 기능 있음
			
		Thread.sleep(5000);
		driver.close(); 	
	}
}

1) 느리게 설정 - 자동화툴 쓰는 의미 없음

2) 우회책

Ctrl + C

Ctrl + V

로 입력하면 된다.

 


다음 로그인

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

public class quiz01 {
	public static void main(String[] args)  throws Exception {
		System.setProperty("webdriver.chrome.driver", "chromedriver.exe");

		WebDriver driver = new ChromeDriver();
		driver.get("https://logins.daum.net/accounts/signinform.do?url=https%3A%2F%2Fwww.daum.net%2F");

		driver.findElement(By.id("id")).sendKeys(Account.id);
		driver.findElement(By.id("inputPwd")).sendKeys(Account.pw);

		driver.findElement(By.id("loginBtn")).click();

		Thread.sleep(5000);
		driver.close(); 

	}
}
public class Account {
	public static final String id ="";
	public static final String pw ="";
}

 

+ Recent posts