Fixed up some gitignore. Added readme info
This commit is contained in:
parent
68ec9d52ed
commit
f2c8aff951
5
.gitignore
vendored
5
.gitignore
vendored
@ -1,3 +1,6 @@
|
||||
target/
|
||||
.vscode/
|
||||
tomcat-binaries/
|
||||
tomcat-binaries/
|
||||
|
||||
src/main/amazon-scrapi/WEB-INF/classes/
|
||||
src/main/amazon-scrapi/WEB-INF/lib/
|
@ -2,6 +2,9 @@
|
||||
|
||||
An API interface with Amazon, that uses webscraping
|
||||
|
||||
# Development Resources
|
||||
- [Intro to servlets](https://dev.to/dilanka-rathnasiri/introduction-to-java-servlets-32oc)
|
||||
|
||||
# Development Environment Setup
|
||||
|
||||
## VSCode / VSCodium
|
||||
|
5
pom.xml
5
pom.xml
@ -42,8 +42,9 @@
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<version>3.3.2</version>
|
||||
<configuration>
|
||||
<webappDirectory>src/main/webapp</webappDirectory>
|
||||
<webXml>src/main/webapp/WEB-INF/web.xml</webXml>
|
||||
<webappDirectory>src/main/amazon-scrapi</webappDirectory>
|
||||
<webXml>src/main/amazon-scrapi/WEB-INF/web.xml</webXml>
|
||||
<failOnMissingWebXml>false</failOnMissingWebXml>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.veritablevalor.blizliam;
|
||||
|
||||
import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.annotation.WebServlet;
|
||||
import jakarta.servlet.http.HttpServlet;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
@ -12,6 +13,10 @@ import com.microsoft.playwright.Browser;
|
||||
import com.microsoft.playwright.Page;
|
||||
import com.microsoft.playwright.Playwright;
|
||||
|
||||
@WebServlet(
|
||||
value = "/hello",
|
||||
name = "hello"
|
||||
)
|
||||
public class App extends HttpServlet {
|
||||
@Override
|
||||
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
|
||||
@ -24,10 +29,20 @@ public class App extends HttpServlet {
|
||||
Page page = browser.newPage();
|
||||
page.navigate(url);
|
||||
|
||||
page.
|
||||
|
||||
boolean loggedIn = page.getByText("Hello, sign in").count() <= 0;
|
||||
|
||||
System.out.println(page.title());
|
||||
out.println("Here is the page.title: " + page.title());
|
||||
|
||||
if (loggedIn)
|
||||
{
|
||||
out.println("Logged in");
|
||||
}
|
||||
else
|
||||
{
|
||||
out.println("Logged out");
|
||||
}
|
||||
}
|
||||
|
||||
out.close();
|
||||
|
@ -0,0 +1,5 @@
|
||||
package com.veritablevalor.blizliam;
|
||||
|
||||
public class Login {
|
||||
|
||||
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user