Compare commits
No commits in common. "68ec9d52edcb6abaf8cf60824df0733895934c34" and "50332fba115fb1b3dfc8fb9c89446c16ceac968a" have entirely different histories.
68ec9d52ed
...
50332fba11
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,2 @@
|
|||||||
target/
|
target/
|
||||||
.vscode/
|
.vscode/
|
||||||
tomcat-binaries/
|
|
23
README.md
23
README.md
@ -1,26 +1,3 @@
|
|||||||
# amazon-scrapi
|
# amazon-scrapi
|
||||||
|
|
||||||
An API interface with Amazon, that uses webscraping
|
An API interface with Amazon, that uses webscraping
|
||||||
|
|
||||||
# Development Environment Setup
|
|
||||||
|
|
||||||
## VSCode / VSCodium
|
|
||||||
|
|
||||||
Install the following softwares
|
|
||||||
- Required for development
|
|
||||||
- Maven
|
|
||||||
- Java JDK
|
|
||||||
- Git
|
|
||||||
- Highly recommended for debugging or deployment
|
|
||||||
- [Apache Tomcat](https://tomcat.apache.org)
|
|
||||||
- Docker
|
|
||||||
|
|
||||||
VSCode Extensions
|
|
||||||
- Extension Pack for Java
|
|
||||||
|
|
||||||
### Tomcat
|
|
||||||
Download binaries for Tomcat.
|
|
||||||
You can get a VSCode extension to deploying project to Tomcat for debugging.
|
|
||||||
Following these guides.
|
|
||||||
- Extension Setup [(Video](https://www.youtube.com/watch?v=R9mugpHWr14) - [Article)](https://www.brandondonnelson.com/2020/06/debugging-java-web-app-in-visual-studio.html).
|
|
||||||
- Helped understand config [(video)](https://www.youtube.com/watch?v=RiPot1ne8rI)
|
|
5
pom.xml
5
pom.xml
@ -28,11 +28,6 @@
|
|||||||
<version>3.8.1</version>
|
<version>3.8.1</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>com.microsoft.playwright</groupId>
|
|
||||||
<artifactId>playwright</artifactId>
|
|
||||||
<version>1.48.0</version>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
@ -8,28 +8,11 @@ import jakarta.servlet.http.HttpServletResponse;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
|
|
||||||
import com.microsoft.playwright.Browser;
|
|
||||||
import com.microsoft.playwright.Page;
|
|
||||||
import com.microsoft.playwright.Playwright;
|
|
||||||
|
|
||||||
public class App extends HttpServlet {
|
public class App extends HttpServlet {
|
||||||
@Override
|
@Override
|
||||||
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
|
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
|
||||||
String url = "https://amazon.com";
|
|
||||||
|
|
||||||
PrintWriter out = resp.getWriter();
|
PrintWriter out = resp.getWriter();
|
||||||
|
out.println("Hello!");
|
||||||
try (Playwright playwright = Playwright.create()) {
|
|
||||||
Browser browser = playwright.chromium().launch();
|
|
||||||
Page page = browser.newPage();
|
|
||||||
page.navigate(url);
|
|
||||||
|
|
||||||
page.
|
|
||||||
|
|
||||||
System.out.println(page.title());
|
|
||||||
out.println("Here is the page.title: " + page.title());
|
|
||||||
}
|
|
||||||
|
|
||||||
out.close();
|
out.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
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.
@ -1,12 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Amazon Scrapi</title>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<h2>Amazon Scrapi</h2>
|
|
||||||
<hr />
|
|
||||||
<p>An API interface with amazon.com using webscraping</p>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
Loading…
x
Reference in New Issue
Block a user