From f926e80f5dc66c80eae7259b7b354403afec1264 Mon Sep 17 00:00:00 2001 From: Nithu Lakshmi Date: Thu, 26 Dec 2024 16:40:40 +0530 Subject: [PATCH 1/3] Initial Commit --- Sensex_Streamer_Project/.classpath | 11 +++ Sensex_Streamer_Project/.project | 17 ++++ .../org.eclipse.core.resources.prefs | 2 + .../.settings/org.eclipse.jdt.core.prefs | 14 +++ .../Sensex_Table_Extraction.class | Bin 0 -> 4513 bytes .../sensex_table/Sensex_Table_Extraction.java | 90 ++++++++++++++++++ 6 files changed, 134 insertions(+) create mode 100644 Sensex_Streamer_Project/.classpath create mode 100644 Sensex_Streamer_Project/.project create mode 100644 Sensex_Streamer_Project/.settings/org.eclipse.core.resources.prefs create mode 100644 Sensex_Streamer_Project/.settings/org.eclipse.jdt.core.prefs create mode 100644 Sensex_Streamer_Project/bin/sensex_table/Sensex_Table_Extraction.class create mode 100644 Sensex_Streamer_Project/src/sensex_table/Sensex_Table_Extraction.java diff --git a/Sensex_Streamer_Project/.classpath b/Sensex_Streamer_Project/.classpath new file mode 100644 index 0000000..900895c --- /dev/null +++ b/Sensex_Streamer_Project/.classpath @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/Sensex_Streamer_Project/.project b/Sensex_Streamer_Project/.project new file mode 100644 index 0000000..b38e8c6 --- /dev/null +++ b/Sensex_Streamer_Project/.project @@ -0,0 +1,17 @@ + + + Sensex_Streamer_Project + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/Sensex_Streamer_Project/.settings/org.eclipse.core.resources.prefs b/Sensex_Streamer_Project/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..99f26c0 --- /dev/null +++ b/Sensex_Streamer_Project/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/Sensex_Streamer_Project/.settings/org.eclipse.jdt.core.prefs b/Sensex_Streamer_Project/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..6e5f874 --- /dev/null +++ b/Sensex_Streamer_Project/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=22 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=22 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=22 diff --git a/Sensex_Streamer_Project/bin/sensex_table/Sensex_Table_Extraction.class b/Sensex_Streamer_Project/bin/sensex_table/Sensex_Table_Extraction.class new file mode 100644 index 0000000000000000000000000000000000000000..070a8708d99d0a0c44b04c13f032da73fcf2c9e7 GIT binary patch literal 4513 zcma)AYjjjs75>g-GWX8phJ+zJE(JP80tq3R@P;H%nvl>ycsU^o|f#t>2dd>d4u!hB0La)r3*W7*;B{i-EoM zL3w!%?~-v+)5eIEw(d6-R12&trkTxUGLGxTb5?u?k6y#_O35Yp7m1)2bqdxp#(q#d zi%{>*xrRhQ!#dOpgq@QKGwIj^jP~N1y|wx96-YKmunKX>pGJW#HMhpMx!4A^Jt{T` zY#Q>sOtvW=A08fVNISMU%7Z=ENi`&$bUbair%f*#Cu){q*UKhpX5*3xn>1|37IJ#f zB*hoj6ysO~0^2lfm*CACCJY^p+dX6+$(pVLGIVt@2=_97vPsvb`|rXbyUN>=oBa&$r#=c$x_6W;#tu;%GmD1 zeg$0u>x*qZi(~C08CDo`pp9g){2bD700#xCn9O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V-r>(H01z zHK3v)uoxWyo*Gzzdjl)6m)3R$>e+6@zQ7i?E$H%-=1M*>=<0 zD8(hFQJD7shp9G!2)%fN-cF#5zP!fFn}9}-#_$XF%IVi*c%Hp^^zIxHnLvd&&llW_ z>{Zg!W90kyw{{$V9`h$d6um}_Wl@XLBj5-XdpPc8 vA?uqda1r0zzj9rA#DBJQD!3Np&VS=DfWPA(Y@_TgWnkY3g%M->&rtaPjEtS! literal 0 HcmV?d00001 diff --git a/Sensex_Streamer_Project/src/sensex_table/Sensex_Table_Extraction.java b/Sensex_Streamer_Project/src/sensex_table/Sensex_Table_Extraction.java new file mode 100644 index 0000000..87ae0f9 --- /dev/null +++ b/Sensex_Streamer_Project/src/sensex_table/Sensex_Table_Extraction.java @@ -0,0 +1,90 @@ +package sensex_table; + +import java.time.Duration; +import java.util.List; +import org.openqa.selenium.By; +import org.openqa.selenium.JavascriptExecutor; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.chrome.ChromeDriver; +import org.openqa.selenium.support.ui.ExpectedConditions; +import org.openqa.selenium.support.ui.WebDriverWait; + +public class Sensex_Table_Extraction { + + public static void main(String[] args) { + WebDriver driver = new ChromeDriver(); + driver.manage().window().maximize(); + + try { + WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(10)); + driver.get("https://www.moneycontrol.com/markets/indian-indices/"); + waitForTheUser(); + + JavascriptExecutor scrollDownOne = (JavascriptExecutor) driver; + scrollDownOne.executeScript("window.scrollBy(0,400)"); + waitForTheUser(); + + // Locate the table by XPath + WebElement table = wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//table[@id='indicesTable']"))); + waitForTheUser(); + + // Get all rows from the table (skip the first row as it's the header) + List rows = table.findElements(By.tagName("tr")); + + // Print the message before extraction + System.out.println("Indian Indices - Markets Terminal : NIFTY 50"); + System.out.println(); + + // Print table headers with outer box + printLine(); // Top border + System.out.printf("| %-20s | %-12s | %-8s | %-8s | %-12s | %-12s | %-12s | %-10s | %-10s | %-15s |\n", + "Name", "LTP", "%Chg", "Chg", "Volume", "Buy Price", "Sell Price", "Buy Qty", "Sell Qty", "Analysis"); + printLine(); // Header separator + + // Loop through each row + for (int i = 1; i < rows.size(); i++) { + WebElement row = rows.get(i); + + // Get all columns (td) in the current row + List cols = row.findElements(By.tagName("td")); + + // Extract the data + if (cols.size() > 1) { + String name = cols.get(0).getText().trim(); // Name (1st column) + String ltp = cols.get(1).getText().trim(); // LTP (2nd column) + String per_chg = cols.get(2).getText().trim(); // %Chg (3rd column) + String chg = cols.get(3).getText().trim(); // Chg (4th column) + String volume = cols.get(4).getText().trim(); // Volume (5th column) + String buy_price = cols.get(5).getText().trim(); // Buy Price (6th column) + String sell_price = cols.get(6).getText().trim(); // Sell Price (7th column) + String buy_qty = cols.get(7).getText().trim(); // Buy Qty (8th column) + String sell_qty = cols.get(8).getText().trim(); // Sell Qty (9th column) + String analysis = cols.get(9).getText().trim(); // Analysis (10th column) + + // Print the extracted data in a table format + System.out.printf("| %-20s | %-12s | %-8s | %-8s | %-12s | %-12s | %-12s | %-10s | %-10s | %-15s |\n", + name, ltp, per_chg, chg, volume, buy_price, sell_price, buy_qty, sell_qty, analysis); + } + } + printLine(); // Bottom border + } catch (Exception e) { + e.printStackTrace(); + } finally { + driver.quit(); + } + } + + // Helper method to print a horizontal line + public static void printLine() { + System.out.println("+----------------------+--------------+----------+----------+--------------+--------------+--------------+------------+------------+-----------------+"); + } + + public static void waitForTheUser() { + try { + Thread.sleep(2000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } +} From 14a9bf590732b4a78ada03a0776409eda34294b4 Mon Sep 17 00:00:00 2001 From: Nithu Lakshmi <110821617+niths09@users.noreply.github.com> Date: Thu, 26 Dec 2024 16:43:56 +0530 Subject: [PATCH 2/3] Delete WikiPopulationScraper directory --- WikiPopulationScraper/.classpath | 11 --- WikiPopulationScraper/.project | 17 ---- .../org.eclipse.core.resources.prefs | 2 - .../.settings/org.eclipse.jdt.core.prefs | 14 ---- .../WebTableDataExtraction.class | Bin 4346 -> 0 bytes .../WebTableDataExtraction.java | 74 ------------------ 6 files changed, 118 deletions(-) delete mode 100644 WikiPopulationScraper/.classpath delete mode 100644 WikiPopulationScraper/.project delete mode 100644 WikiPopulationScraper/.settings/org.eclipse.core.resources.prefs delete mode 100644 WikiPopulationScraper/.settings/org.eclipse.jdt.core.prefs delete mode 100644 WikiPopulationScraper/bin/data_extraction/WebTableDataExtraction.class delete mode 100644 WikiPopulationScraper/src/data_extraction/WebTableDataExtraction.java diff --git a/WikiPopulationScraper/.classpath b/WikiPopulationScraper/.classpath deleted file mode 100644 index 900895c..0000000 --- a/WikiPopulationScraper/.classpath +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/WikiPopulationScraper/.project b/WikiPopulationScraper/.project deleted file mode 100644 index 68201ba..0000000 --- a/WikiPopulationScraper/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - WikiPopulationScraper - - - - - - org.eclipse.jdt.core.javabuilder - - - - - - org.eclipse.jdt.core.javanature - - diff --git a/WikiPopulationScraper/.settings/org.eclipse.core.resources.prefs b/WikiPopulationScraper/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 99f26c0..0000000 --- a/WikiPopulationScraper/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -encoding/=UTF-8 diff --git a/WikiPopulationScraper/.settings/org.eclipse.jdt.core.prefs b/WikiPopulationScraper/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 6e5f874..0000000 --- a/WikiPopulationScraper/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,14 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=22 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=22 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning -org.eclipse.jdt.core.compiler.release=enabled -org.eclipse.jdt.core.compiler.source=22 diff --git a/WikiPopulationScraper/bin/data_extraction/WebTableDataExtraction.class b/WikiPopulationScraper/bin/data_extraction/WebTableDataExtraction.class deleted file mode 100644 index 1811f0ffd52968e21c425ba7ee677544878765f6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4346 zcmb_g`&$&(8Ga8eJIgYFK~UEivq?3A0;`zV1T;nv3Zm|eptjGnx2KA1Hf)RZ+$TVO-uslH{a20hobCpwyjHQXhz!*M54PEOj> zMk+5YX`6*?Dn02sS()ncUx!`utaRg8hsr9{V}phUfqTN1(JO(lj*ZyFb7u|Pn2-WZ zjZJ-PF4%S~r~I1lsKRD!(QvoG_7Ai`$356eO*5vQac1b8J8By7C8;Qh`!(Drux)Kc zfxM0nsYu1L#;ln&pOux^jvX2vD2eyrT;7ve9gS#WtepZw-w-(7bW+FZb&tN6Mz$k{ zT>=mFnRzeij3?7h!DdWkK55vQq$ge1^c=rGHkb4q&#;m?Cs(ix<)S!RkkZg9u-*@8 z>CQTKV~>EAQ_3uczM(NZ@_PlE!_J*A}y;b9UWmCG!4h_ zn83iK=jHP4sg$%^XUr)xCo`tes*a|5Ddpo)XMA+Y$D{P|Xhst78EL2K^wF`o(Pj54 zgm>!bQeG^dkX{@D-8y`kCQwg?%SziDayn&~#d9kU2=s*m zkUGPSSxc3V?5A~%;u)TknQdA$xOmP2d#Uk)9o!;4#YR~8G>i#s4Lc|EvO73M3>kqk zkKFtu#&t|6&uX4AF<@k66%3d<&R|MFA1CJ(*Dxh_u5n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?pyyOhdhfHVsEK7#gxni2vY5*=^##ESLp# zUFg^F^LPcV;>Sdg7I=#LtMsX@$1fM~tILQz!6bP7ia!{o=v6vEWmz4~0=l`dhy5em zxpyh!;=alAoL6S?{}sI&u12`<8oMfW7Ws~G%eVNuiMQF?%-KKU&-g22znS&Lt!O2& KP>;VwEB^-~xW|P6 diff --git a/WikiPopulationScraper/src/data_extraction/WebTableDataExtraction.java b/WikiPopulationScraper/src/data_extraction/WebTableDataExtraction.java deleted file mode 100644 index dbb0edc..0000000 --- a/WikiPopulationScraper/src/data_extraction/WebTableDataExtraction.java +++ /dev/null @@ -1,74 +0,0 @@ -package data_extraction; - -import java.time.Duration; -import java.util.List; -import org.openqa.selenium.By; -import org.openqa.selenium.JavascriptExecutor; -import org.openqa.selenium.WebDriver; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.chrome.ChromeDriver; -import org.openqa.selenium.support.ui.ExpectedConditions; -import org.openqa.selenium.support.ui.WebDriverWait; - -public class WebTableDataExtraction { - - public static void main(String[] args) { - WebDriver driver = new ChromeDriver(); - driver.manage().window().maximize(); - - try { - // Print the message before extraction - System.out.println("List of countries and territories by total population"); - - // Open the Wikipedia page - WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(10)); - driver.get("https://en.wikipedia.org/wiki/List_of_countries_and_dependencies_by_population"); - waitForTheUser(); - - JavascriptExecutor scrollDownOne = (JavascriptExecutor) driver; - scrollDownOne.executeScript("window.scrollBy(0,1200)"); - waitForTheUser(); - - // Locate the table by XPath - WebElement table = wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//table[@class='wikitable sortable sticky-header sort-under mw-datatable col2left col6left jquery-tablesorter']"))); - waitForTheUser(); - - // Get all rows from the table (skip the first row as it's the header) - List rows = table.findElements(By.tagName("tr")); - - // Loop through each row - for (int i = 1; i < rows.size(); i++) { // Start from 1 to skip header - WebElement row = rows.get(i); - - // Get all columns (td) in the current row - List cols = row.findElements(By.tagName("td")); - - // Extract the Location, Population, % of world, Date, Source and Notes - if (cols.size() > 1) { - String location = cols.get(0).getText().trim(); // Location (1st column) - String population = cols.get(1).getText().trim(); // Population (2nd column) - String perc_world = cols.get(2).getText().trim(); // % of world (3rd column) - String date = cols.get(3).getText().trim(); // Date (4th column) - String source = cols.get(4).getText().trim(); // Source (5th column) - String notes = cols.get(5).getText().trim(); // Notes (6th column) - - // Print the extracted data - System.out.println("Location: " + location + " | Population: " + population + " | % of world: " + perc_world + " | Date: " + date + " | Source: " + source + " | Notes: " + notes); - } - } - } catch (Exception e) { - e.printStackTrace(); - } finally { - // Close the browser after scraping - driver.quit(); - } - } - - public static void waitForTheUser() { - try { - Thread.sleep(2000); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } -} From ef95f5aa5789ad4641dde31c1ef0c9545bb9de8b Mon Sep 17 00:00:00 2001 From: Nithu Lakshmi <110821617+niths09@users.noreply.github.com> Date: Thu, 26 Dec 2024 16:44:48 +0530 Subject: [PATCH 3/3] Initial README.md --- README.md | 59 +++++++++++++++++++++++++++++++++---------------------- 1 file changed, 36 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index f4eeb3f..9513b3a 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,41 @@ -# Wikipedia Population Table Data Extraction +# Sensex Table Extraction -This project demonstrates web scraping using Selenium WebDriver to extract data from an HTML table on a Wikipedia page. Specifically, it retrieves the list of countries and territories by total population, presenting a real-world example of data extraction and automation using Selenium. +This project automates the extraction of data from the Indian Indices table on the MoneyControl website. The extracted data provides insights into NIFTY 50 market trends, including real-time values such as the Last Traded Price (LTP), percentage change, volume and more. The data is displayed in a neatly formatted table in the console. ## Features -- Automates navigation to a Wikipedia page on country populations. -- Extracts data from an HTML table, including: - - **Location** (Country or territory) - - **Population** - - **Percentage of world population** - - **Date** of population data - - **Source** of the data - - **Notes** -- Processes table rows dynamically to handle updates to the table structure or content. -- Uses JavaScript for smooth scrolling to the target table. - -## Prerequisites -Ensure you have the following before running the project: -1. **Java Development Kit (JDK)** - Version 8 or above. -2. **Google Chrome** - Latest stable version. -3. **ChromeDriver** - Version compatible with your Chrome browser. -4. **Selenium WebDriver** - Included in the project dependencies. + +### Indian Indices Extraction +- Extracts live data from the **Indian Indices - NIFTY 50** table on the MoneyControl website. +- Columns extracted include: + - **Name**: Name of the stock or index. + - **LTP**: Last traded price. + - **%Chg**: Percentage change in price. + - **Chg**: Change in price. + - **Volume**: Total trading volume. + - **Buy Price**: Current buy price. + - **Sell Price**: Current sell price. + - **Buy Qty**: Quantity available for buying. + - **Sell Qty**: Quantity available for selling. + - **Analysis**: Additional analysis details. + +### Console Output +- Displays the extracted data in a visually formatted table with proper alignment and separators for easy readability. + +### Scroll Functionality +- Uses JavaScript Executor to scroll the webpage to ensure that the dynamic content is fully loaded before extraction. + +## Pre-requisites + +Before running this project, ensure the following are installed: +1. **Java Development Kit (JDK)** - Version 8 or higher. +2. **Selenium WebDriver** - Include Selenium libraries in your project. +3. **Google Chrome** - Latest version of the Chrome browser. +4. **ChromeDriver** - Ensure the ChromeDriver version matches your Chrome browser. +5. **Integrated Development Environment (IDE)** - IntelliJ IDEA, Eclipse, or any other IDE for Java development. ## Technologies Used -- **Java** - The programming language for the project. -- **Selenium WebDriver** - For web element interaction and automation. -- **Google Chrome & ChromeDriver** - For browser-based automation. -- **JavaScript Executor** - For advanced browser interactions like scrolling. + +- **Java** - Programming language used for development. +- **Selenium WebDriver** - To interact with and extract data from the MoneyControl website. +- **Google Chrome & ChromeDriver** - For browsing and interacting with the webpage. +- **JavaScript Executor** - For scrolling functionality.