Initial commit
This commit is contained in:
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
/.vs/
|
||||
/ConsoleApp3/bin/
|
||||
/ConsoleApp3/obj/
|
||||
25
ConsoleApp3.sln
Normal file
25
ConsoleApp3.sln
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.6.33815.320
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp3", "ConsoleApp3\ConsoleApp3.csproj", "{4CB462A0-22BB-4E70-9C0B-203560329AFE}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{4CB462A0-22BB-4E70-9C0B-203560329AFE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{4CB462A0-22BB-4E70-9C0B-203560329AFE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{4CB462A0-22BB-4E70-9C0B-203560329AFE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{4CB462A0-22BB-4E70-9C0B-203560329AFE}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {81DF414B-B2C2-4A3E-B78C-413128074B0C}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
14
ConsoleApp3/ConsoleApp3.csproj
Normal file
14
ConsoleApp3/ConsoleApp3.csproj
Normal file
@@ -0,0 +1,14 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Selenium.WebDriver" Version="4.10.0" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
60
ConsoleApp3/Program.cs
Normal file
60
ConsoleApp3/Program.cs
Normal file
@@ -0,0 +1,60 @@
|
||||
// See https://aka.ms/new-console-template for more information
|
||||
|
||||
using OpenQA.Selenium.Chrome;
|
||||
using OpenQA.Selenium;
|
||||
using System.Diagnostics;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
|
||||
Console.WriteLine("Hello, World!");
|
||||
|
||||
/*
|
||||
*
|
||||
* referalPage: /de/OnePiece
|
||||
username: Skywalkerex
|
||||
userPassword: Magnatpower310!!
|
||||
/de/OnePiece/PostGetAction/User_Login
|
||||
*/
|
||||
|
||||
|
||||
|
||||
ChromeOptions options = new ChromeOptions();
|
||||
options.AddArgument("start-maximized");
|
||||
ChromeDriver cd = new ChromeDriver(options);
|
||||
cd.Url = @"https://www.cardmarket.com/de/OnePiece";
|
||||
|
||||
cd.Navigate();
|
||||
cd.FindElement(By.CssSelector("#CookiesConsent > div > div > form > button")).Click();
|
||||
cd.FindElement(By.Name("username")).Click();
|
||||
cd.FindElement(By.Name("username")).SendKeys("Skywalkerex");
|
||||
cd.FindElement(By.Name("userPassword")).Click();
|
||||
|
||||
|
||||
cd.FindElement(By.Name("userPassword")).SendKeys("Magnatpower310!!");
|
||||
cd.FindElement(By.CssSelector("#header-login > input.btn.AB-login-btn.btn-outline-primary.btn-sm")).Click();
|
||||
|
||||
|
||||
CookieContainer cookieContainer = new CookieContainer();
|
||||
foreach (var c in cd.Manage().Cookies.AllCookies)
|
||||
{
|
||||
string name = c.Name;
|
||||
string value = c.Value;
|
||||
cookieContainer.Add(new System.Net.Cookie(name, value,c.Path,c.Domain));
|
||||
}
|
||||
|
||||
HttpWebRequest hwr = (HttpWebRequest)HttpWebRequest.Create(@"https://www.cardmarket.com/de/OnePiece/Orders/Sales/Paid");
|
||||
hwr.CookieContainer = cookieContainer;
|
||||
hwr.Method = "GET";
|
||||
hwr.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36";
|
||||
WebResponse wr = hwr.GetResponse();
|
||||
string s = new StreamReader(wr.GetResponseStream()).ReadToEnd();
|
||||
Console.WriteLine(s);
|
||||
|
||||
string GetHashKey(string line)
|
||||
{
|
||||
var x = line.IndexOf("__cmtkn");
|
||||
var d = line.Substring(x + 16);
|
||||
var m = d.IndexOf("\"");
|
||||
var a = d.Substring(0, m);
|
||||
return a;
|
||||
}
|
||||
Reference in New Issue
Block a user