Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "log"
- "time"
- "github.com/tebeka/selenium"
- "github.com/tebeka/selenium/chrome"
- )
- func main() {
- service, err := selenium.NewChromeDriverService("./chromedriver", 4444)
- if err != nil {
- log.Fatal("Error:", err)
- }
- defer service.Stop()
- caps := selenium.Capabilities{}
- caps.AddChrome(chrome.Capabilities{Args: []string{
- "--headless", // comment out this line for testing
- }})
- driver, err := selenium.NewRemote(caps, "")
- // steam
- _ = driver.Get("https://steamcommunity.com")
- time.Sleep(3 * time.Second)
- cookie_login := &selenium.Cookie{
- Name: "steamLoginSecure",
- Value: "76561199299175343%7C%7CeyAidHlwIjogIkpXVCIsICJhbGciOiAiRWREU0EiIH0.eyAiaXNzIjogInI6MEY5MV8yNEM5RDIzRV9BMzc0QiIsICJzdWIiOiAiNzY1NjExOTkyOTkxNzUzNDMiLCAiYXVkIjogWyAid2ViOmNvbW11bml0eSIgXSwgImV4cCI6IDE3MjIwOTMyODgsICJuYmYiOiAxNzEzMzY2MTQzLCAiaWF0IjogMTcyMjAwNjE0MywgImp0aSI6ICIwRjg0XzI0QzlEMjQwXzdFNUVFIiwgIm9hdCI6IDE3MjIwMDYxNDMsICJydF9leHAiOiAxNzQwMjM1NzQ5LCAicGVyIjogMCwgImlwX3N1YmplY3QiOiAiOTUuMjIxLjE3MC4xMDQiLCAiaXBfY29uZmlybWVyIjogIjk1LjIyMS4xNzAuMTA0IiB9.C77oCmH8hNLGIiz3jbppjCDpkxg49wRtzKPs5o_u21dsijhhkCKN-BBhG7pHHDHT_e2jSmlvqd_OGVDb-Rv7DA",
- Path: "/",
- Domain: "steamcommunity.com",
- Secure: true,
- }
- driver.AddCookie(cookie_login)
- cookies, _ := driver.GetCookies()
- for _, cookie := range cookies {
- log.Printf("Cookie: %s=%s", cookie.Name, cookie.Value)
- }
- // err = driver.Get("https://csgorun.bet")
- // el, _ := driver.FindElement(selenium.ByXPATH, "/html/body/div[1]/div[2]/div/div[1]/header/button")
- // err = el.Click()
- // if err != nil {
- // log.Fatal(err)
- // }
- // el_steam, _ := driver.FindElement(selenium.ByXPATH, "/html/body/div[3]/div/div[2]/div/button[1]")
- // el_steam.Click()
- // err = driver.Get("https://csgorun.bet/crash")
- time.Sleep(6000 * time.Second)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement