Advertisement
den4ik2003

Untitled

Jul 27th, 2024
307
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 1.84 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4.     "log"
  5.     "time"
  6.  
  7.     "github.com/tebeka/selenium"
  8.     "github.com/tebeka/selenium/chrome"
  9. )
  10.  
  11. func main() {
  12.     service, err := selenium.NewChromeDriverService("./chromedriver", 4444)
  13.  
  14.     if err != nil {
  15.         log.Fatal("Error:", err)
  16.     }
  17.  
  18.     defer service.Stop()
  19.  
  20.     caps := selenium.Capabilities{}
  21.     caps.AddChrome(chrome.Capabilities{Args: []string{
  22.         "--headless", // comment out this line for testing
  23.     }})
  24.     driver, err := selenium.NewRemote(caps, "")
  25.  
  26.     // steam
  27.     _ = driver.Get("https://steamcommunity.com")
  28.  
  29.     time.Sleep(3 * time.Second)
  30.  
  31.     cookie_login := &selenium.Cookie{
  32.         Name:   "steamLoginSecure",
  33.         Value:  "76561199299175343%7C%7CeyAidHlwIjogIkpXVCIsICJhbGciOiAiRWREU0EiIH0.eyAiaXNzIjogInI6MEY5MV8yNEM5RDIzRV9BMzc0QiIsICJzdWIiOiAiNzY1NjExOTkyOTkxNzUzNDMiLCAiYXVkIjogWyAid2ViOmNvbW11bml0eSIgXSwgImV4cCI6IDE3MjIwOTMyODgsICJuYmYiOiAxNzEzMzY2MTQzLCAiaWF0IjogMTcyMjAwNjE0MywgImp0aSI6ICIwRjg0XzI0QzlEMjQwXzdFNUVFIiwgIm9hdCI6IDE3MjIwMDYxNDMsICJydF9leHAiOiAxNzQwMjM1NzQ5LCAicGVyIjogMCwgImlwX3N1YmplY3QiOiAiOTUuMjIxLjE3MC4xMDQiLCAiaXBfY29uZmlybWVyIjogIjk1LjIyMS4xNzAuMTA0IiB9.C77oCmH8hNLGIiz3jbppjCDpkxg49wRtzKPs5o_u21dsijhhkCKN-BBhG7pHHDHT_e2jSmlvqd_OGVDb-Rv7DA",
  34.         Path:   "/",
  35.         Domain: "steamcommunity.com",
  36.         Secure: true,
  37.     }
  38.     driver.AddCookie(cookie_login)
  39.  
  40.     cookies, _ := driver.GetCookies()
  41.     for _, cookie := range cookies {
  42.         log.Printf("Cookie: %s=%s", cookie.Name, cookie.Value)
  43.     }
  44.  
  45.     // err = driver.Get("https://csgorun.bet")
  46.     // el, _ := driver.FindElement(selenium.ByXPATH, "/html/body/div[1]/div[2]/div/div[1]/header/button")
  47.  
  48.     // err = el.Click()
  49.     // if err != nil {
  50.     //  log.Fatal(err)
  51.     // }
  52.  
  53.     // el_steam, _ := driver.FindElement(selenium.ByXPATH, "/html/body/div[3]/div/div[2]/div/button[1]")
  54.     // el_steam.Click()
  55.  
  56.     // err = driver.Get("https://csgorun.bet/crash")
  57.  
  58.     time.Sleep(6000 * time.Second)
  59. }
  60.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement