SlideShare a Scribd company logo
Intro to Javascript: Building a Scraper
February 2017
http://bit.ly/thinkful-javascript-scraper
About me
• Jasjit Singh
• Self-taught developer
• Worked in finance & tech
• Co-Founder Hotspot
• Thinkful General Manager
About us
Thinkful prepares students for web development & data
science jobs through 1-on-1 mentorship programs
What’s your goal?
• Do you want to work better with developers?
• Do you want to start working as a developer?
• Do you have an idea that you want to build?
What’s your programming background?
• First lines of code will be written tonight?
• Been self teaching for 1-3 months?
• Been at this for 3+ months
Goals
• Javascript overview
• Working with HTML
• Scraper walkthrough + drills
• Email scraping demo
Clients / Servers
Client
Frontend Developer
Server
Backend Developer
What are we learning today?
100% of client-side code (for the web) is written in
Javascript. You can also use Javascript to write server-
side code thanks to Node.js.
History of Javascript
• Written by Brendan Eich in 1995 for use in Netscape
• Initial version written in just 10 days
• Completely unrelated to Java, maybe named after it to
draft off popularity
• Over 10 years, became default language for browsers
Javascript today
Javascript is the most common language on Github
Also…
• Exceptional community of developers, libraries, and
frameworks
• Great place for beginners to start programming
• Lots of job opportunities
• Continues to evolve under guidance of Ecma
International, with input from top tech companies
What is a scraper?
A scraper goes around the internet for us and “scrapes”
data from websites. Today we’ll make a simple scraper to
grab emails from a website.
Anatomy of a webpage
• HTML - defines content & structure of a page
(filename: index.html)
• CSS - defines visual presentation of page
(filename: index.css)
• Javascript - defines behavior of a page
(filename: index.js)
HTML elements
http://bit.ly/tf-scraper
<html>
<h1 class=“hello-world”>Hello world!</h1>
</html>
Using Javascript to interact with HTML
We can use Javascript to “grab” an HTML element, store it in a
variable and do something with it.
What is a variable?
A variable is a name that is attached to a value. It gives us a
shorthand way to refer to values created in the program
//set the variable “x” to “3”
var x = 3;
//print the variable
console.log(x);
Things you can assign to a variable
• String
• Number
• Boolean
• Null
• Undefined
• Object
• Array
Grabbing elements of a certain class
//grabs elements with class name “hello world”
document.getElementsByClassName(“hello-
world”);
Starting to put it together
//store array of elements in variable “hello”
var hello =
document.getElementsByClassName(“hello-
world”);
What is an array?
Arrays store multiple values in a single variable:
var cars = ["Saab", "Volvo", "BMW"];
Array indexes are zero-based: The first element in the array is
0, the second is 1, and so on.
What will this print?
console.log(cars[0])
Using Javascript to interact with HTML
//array of elements with class “hello-world”
var hello =
document.getElementsByClassName(“hello-
world”);
//set variable first_item to first item
var first_item = hello[0]
//print text of first_item
console.log(text.textContent)
Quick drill
Add this to your CodePen HTML
<span class=“goodbye”>Goodbye!</span>
See if you can use Javascript to print out the text in
this element
Full demonstration
https://www.osu.edu/findpeople/
More about Thinkful
• Anyone who’s committed can learn to code
• 1-on-1 mentorship is the best way to learn
• Flexibility matters — learn anywhere, anytime
• We only make money when you get a job
Our Program
You’ll learn concepts, practice with drills, and build capstone
projects for your own portfolio — all guided by a personal mentor
Our Mentors
Mentors have, on average, 10+ years of experience
Our Results
Job Titles after GraduationMonths until Employed
Special Prep Course Offer
• Three-week program, includes six mentor sessions
• Covers HTML/CSS, Javascript, jQuery, Responsive Design
• Option to continue into web development bootcamp
• Prep course costs $500 (can apply to cost of full bootcamp)
• Talk to me (or email me) about special offer
October 2015
Questions?
email me at jas@thinkful.com
or schedule a call through thinkful.com

More Related Content

PDF
Tf byowwhc
Shannon Gallagher
 
PDF
Tf byowwhc
Shannon Gallagher
 
PPTX
Angular and SEO - Greenlane All Hands Day 10/17/16
Sean Malseed
 
PPTX
Activity 5
John Vincent Caño
 
PDF
Tf byows
Shannon Gallagher
 
PDF
Lesson 01
Gene Babon
 
PPTX
Java script tutorial
Son Nguyen
 
PDF
Lesson 01
Gene Babon
 
Tf byowwhc
Shannon Gallagher
 
Tf byowwhc
Shannon Gallagher
 
Angular and SEO - Greenlane All Hands Day 10/17/16
Sean Malseed
 
Activity 5
John Vincent Caño
 
Lesson 01
Gene Babon
 
Java script tutorial
Son Nguyen
 
Lesson 01
Gene Babon
 

What's hot (20)

PDF
Tf byows
Shannon Gallagher
 
PPTX
Java script introduction
Jesus Obenita Jr.
 
PDF
Lesson 01
Gene Babon
 
PDF
Tf byow
Shannon Gallagher
 
PDF
Tf byow
Shannon Gallagher
 
PPTX
JavaScript : A trending scripting language
AbhayDhupar
 
PDF
The Ideas of Clojure - Things I learn from Clojure
Hsuan Fu Lien
 
PPTX
AngularJS + NancyFx + MongoDB = The best trio for ultimate SPA by Bojan Velja...
Bojan Veljanovski
 
PPTX
Presentation
Nikhilesh Sharma
 
PDF
Web dev syllabus
Adithcheshan
 
PDF
Instagram filters (8 24)
Ivy Rueb
 
PPTX
Building Native Android Apps with JavaScript
Abhishek Kant
 
PDF
Instagram filters (8 24)
Ivy Rueb
 
PDF
Deck 893ff61f-1fb8-4e15-a379-775dfdbcee77-12-173-252-450
Justin Ezor
 
PDF
Beyond the Standards
Paul Bakaus
 
PDF
Introduction to HTML5
Mohammad Tahsin Alshalabi
 
PDF
Php workshop L0 Introduction
Mohammad Tahsin Alshalabi
 
PPTX
Grzegorz Witek - MongoDB + RoR, Mongoid (PRUG 1.0)
ecommerce poland expo
 
ODP
Css,javascript,php,mysql
vurimi prasad
 
PPTX
Developing word press professionally
Austin Gil
 
Java script introduction
Jesus Obenita Jr.
 
Lesson 01
Gene Babon
 
JavaScript : A trending scripting language
AbhayDhupar
 
The Ideas of Clojure - Things I learn from Clojure
Hsuan Fu Lien
 
AngularJS + NancyFx + MongoDB = The best trio for ultimate SPA by Bojan Velja...
Bojan Veljanovski
 
Presentation
Nikhilesh Sharma
 
Web dev syllabus
Adithcheshan
 
Instagram filters (8 24)
Ivy Rueb
 
Building Native Android Apps with JavaScript
Abhishek Kant
 
Instagram filters (8 24)
Ivy Rueb
 
Deck 893ff61f-1fb8-4e15-a379-775dfdbcee77-12-173-252-450
Justin Ezor
 
Beyond the Standards
Paul Bakaus
 
Introduction to HTML5
Mohammad Tahsin Alshalabi
 
Php workshop L0 Introduction
Mohammad Tahsin Alshalabi
 
Grzegorz Witek - MongoDB + RoR, Mongoid (PRUG 1.0)
ecommerce poland expo
 
Css,javascript,php,mysql
vurimi prasad
 
Developing word press professionally
Austin Gil
 
Ad

Viewers also liked (7)

PDF
Building a game with JavaScript (March 2017, washington dc)
Daniel Friedman
 
PDF
Building a rockstar portfolio (3:22)
Thinkful
 
PDF
Let’s talk about JavaScript - WebElement
Marian Rusnak
 
PPTX
Javascript
Sun Technlogies
 
PDF
Alphorm.com Support de la formation JavaScript les fondamentaux
Alphorm
 
PDF
Alphorm.com Support de la Formation JavaScript , avancé
Alphorm
 
PPT
JavaScript Frameworks and Java EE – A Great Match
Reza Rahman
 
Building a game with JavaScript (March 2017, washington dc)
Daniel Friedman
 
Building a rockstar portfolio (3:22)
Thinkful
 
Let’s talk about JavaScript - WebElement
Marian Rusnak
 
Javascript
Sun Technlogies
 
Alphorm.com Support de la formation JavaScript les fondamentaux
Alphorm
 
Alphorm.com Support de la Formation JavaScript , avancé
Alphorm
 
JavaScript Frameworks and Java EE – A Great Match
Reza Rahman
 
Ad

Similar to Intro javascript build a scraper (3:22) (20)

PDF
Intro to JavaScript - Thinkful LA, June 2017
Thinkful
 
PDF
Build a game with javascript (april 2017)
Thinkful
 
PPTX
Untangling7
Derek Jacoby
 
PPTX
Javascript note for engineering notes.pptx
engineeradda55
 
PPT
Applied component i unit 2
Pramod Redekar
 
PDF
Thinkful - Intro to JavaScript
TJ Stalcup
 
PDF
Wt unit 2 ppts client sied technology
PUNE VIDYARTHI GRIHA'S COLLEGE OF ENGINEERING, NASHIK
 
PDF
Wt unit 2 ppts client side technology
PUNE VIDYARTHI GRIHA'S COLLEGE OF ENGINEERING, NASHIK
 
PDF
lect4
tutorialsruby
 
PDF
lect4
tutorialsruby
 
PDF
HSC INFORMATION TECHNOLOGY CHAPTER 3 ADVANCED JAVASCRIPT
AAFREEN SHAIKH
 
PDF
Introjs10.5.17SD
Thinkful
 
PDF
Intro to javascript (6:27)
David Coulter
 
ODP
JavaScript and jQuery Fundamentals
BG Java EE Course
 
PPTX
Web technologies-course 07.pptx
Stefan Oprea
 
PPT
lecture 6 javascript event and event handling.ppt
ULADATZ
 
PPTX
UNIT 1 (7).pptx
DrDhivyaaCRAssistant
 
PPTX
Monster JavaScript Course - 50+ projects and applications
Laurence Svekis ✔
 
PPT
JavaScript Misunderstood
Bhavya Siddappa
 
PPTX
Journey To The Front End World - Part3 - The Machine
Irfan Maulana
 
Intro to JavaScript - Thinkful LA, June 2017
Thinkful
 
Build a game with javascript (april 2017)
Thinkful
 
Untangling7
Derek Jacoby
 
Javascript note for engineering notes.pptx
engineeradda55
 
Applied component i unit 2
Pramod Redekar
 
Thinkful - Intro to JavaScript
TJ Stalcup
 
Wt unit 2 ppts client sied technology
PUNE VIDYARTHI GRIHA'S COLLEGE OF ENGINEERING, NASHIK
 
Wt unit 2 ppts client side technology
PUNE VIDYARTHI GRIHA'S COLLEGE OF ENGINEERING, NASHIK
 
HSC INFORMATION TECHNOLOGY CHAPTER 3 ADVANCED JAVASCRIPT
AAFREEN SHAIKH
 
Introjs10.5.17SD
Thinkful
 
Intro to javascript (6:27)
David Coulter
 
JavaScript and jQuery Fundamentals
BG Java EE Course
 
Web technologies-course 07.pptx
Stefan Oprea
 
lecture 6 javascript event and event handling.ppt
ULADATZ
 
UNIT 1 (7).pptx
DrDhivyaaCRAssistant
 
Monster JavaScript Course - 50+ projects and applications
Laurence Svekis ✔
 
JavaScript Misunderstood
Bhavya Siddappa
 
Journey To The Front End World - Part3 - The Machine
Irfan Maulana
 

More from Thinkful (20)

PDF
893ff61f-1fb8-4e15-a379-775dfdbcee77-7-14-25-46-115-141-308-324-370
Thinkful
 
PDF
LA 1/31/18 Intro to JavaScript: Fundamentals
Thinkful
 
PDF
LA 1/31/18 Intro to JavaScript: Fundamentals
Thinkful
 
PDF
Itjsf129
Thinkful
 
PDF
Twit botsd1.30.18
Thinkful
 
PDF
Build your-own-instagram-filters-with-javascript-202-335 (1)
Thinkful
 
PDF
Baggwjs124
Thinkful
 
PDF
Become a Data Scientist: A Thinkful Info Session
Thinkful
 
PDF
Vpet sd-1.25.18
Thinkful
 
PDF
LA 1/18/18 Become A Web Developer: A Thinkful Info Session
Thinkful
 
PDF
How to Choose a Programming Language
Thinkful
 
PDF
Batbwjs117
Thinkful
 
PDF
1/16/18 Intro to JS Workshop
Thinkful
 
PDF
LA 1/16/18 Intro to Javascript: Fundamentals
Thinkful
 
PDF
(LA 1/16/18) Intro to JavaScript: Fundamentals
Thinkful
 
PDF
Websitesd1.15.17.
Thinkful
 
PDF
Bavpwjs110
Thinkful
 
PDF
Byowwhc110
Thinkful
 
PDF
Getting started-jan-9-2018
Thinkful
 
PDF
Introjs1.9.18tf
Thinkful
 
893ff61f-1fb8-4e15-a379-775dfdbcee77-7-14-25-46-115-141-308-324-370
Thinkful
 
LA 1/31/18 Intro to JavaScript: Fundamentals
Thinkful
 
LA 1/31/18 Intro to JavaScript: Fundamentals
Thinkful
 
Itjsf129
Thinkful
 
Twit botsd1.30.18
Thinkful
 
Build your-own-instagram-filters-with-javascript-202-335 (1)
Thinkful
 
Baggwjs124
Thinkful
 
Become a Data Scientist: A Thinkful Info Session
Thinkful
 
Vpet sd-1.25.18
Thinkful
 
LA 1/18/18 Become A Web Developer: A Thinkful Info Session
Thinkful
 
How to Choose a Programming Language
Thinkful
 
Batbwjs117
Thinkful
 
1/16/18 Intro to JS Workshop
Thinkful
 
LA 1/16/18 Intro to Javascript: Fundamentals
Thinkful
 
(LA 1/16/18) Intro to JavaScript: Fundamentals
Thinkful
 
Websitesd1.15.17.
Thinkful
 
Bavpwjs110
Thinkful
 
Byowwhc110
Thinkful
 
Getting started-jan-9-2018
Thinkful
 
Introjs1.9.18tf
Thinkful
 

Recently uploaded (20)

PDF
Study Material and notes for Women Empowerment
ComputerScienceSACWC
 
PPTX
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
PDF
PG-BPSDMP 2 TAHUN 2025PG-BPSDMP 2 TAHUN 2025.pdf
AshifaRamadhani
 
PDF
Antianginal agents, Definition, Classification, MOA.pdf
Prerana Jadhav
 
PDF
Sunset Boulevard Student Revision Booklet
jpinnuck
 
PPTX
Five Point Someone – Chetan Bhagat | Book Summary & Analysis by Bhupesh Kushwaha
Bhupesh Kushwaha
 
PDF
The-Invisible-Living-World-Beyond-Our-Naked-Eye chapter 2.pdf/8th science cur...
Sandeep Swamy
 
PPTX
PREVENTIVE PEDIATRIC. pptx
AneetaSharma15
 
PDF
Presentation of the MIPLM subject matter expert Erdem Kaya
MIPLM
 
PPTX
PPTs-The Rise of Empiresghhhhhhhh (1).pptx
academysrusti114
 
PDF
RA 12028_ARAL_Orientation_Day-2-Sessions_v2.pdf
Seven De Los Reyes
 
DOCX
Action Plan_ARAL PROGRAM_ STAND ALONE SHS.docx
Levenmartlacuna1
 
PDF
2.Reshaping-Indias-Political-Map.ppt/pdf/8th class social science Exploring S...
Sandeep Swamy
 
PDF
BÀI TẬP TEST BỔ TRỢ THEO TỪNG CHỦ ĐỀ CỦA TỪNG UNIT KÈM BÀI TẬP NGHE - TIẾNG A...
Nguyen Thanh Tu Collection
 
PPTX
Trends in pediatric nursing .pptx
AneetaSharma15
 
PDF
UTS Health Student Promotional Representative_Position Description.pdf
Faculty of Health, University of Technology Sydney
 
PPTX
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 
PPTX
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
PPTX
CDH. pptx
AneetaSharma15
 
PPTX
An introduction to Prepositions for beginners.pptx
drsiddhantnagine
 
Study Material and notes for Women Empowerment
ComputerScienceSACWC
 
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
PG-BPSDMP 2 TAHUN 2025PG-BPSDMP 2 TAHUN 2025.pdf
AshifaRamadhani
 
Antianginal agents, Definition, Classification, MOA.pdf
Prerana Jadhav
 
Sunset Boulevard Student Revision Booklet
jpinnuck
 
Five Point Someone – Chetan Bhagat | Book Summary & Analysis by Bhupesh Kushwaha
Bhupesh Kushwaha
 
The-Invisible-Living-World-Beyond-Our-Naked-Eye chapter 2.pdf/8th science cur...
Sandeep Swamy
 
PREVENTIVE PEDIATRIC. pptx
AneetaSharma15
 
Presentation of the MIPLM subject matter expert Erdem Kaya
MIPLM
 
PPTs-The Rise of Empiresghhhhhhhh (1).pptx
academysrusti114
 
RA 12028_ARAL_Orientation_Day-2-Sessions_v2.pdf
Seven De Los Reyes
 
Action Plan_ARAL PROGRAM_ STAND ALONE SHS.docx
Levenmartlacuna1
 
2.Reshaping-Indias-Political-Map.ppt/pdf/8th class social science Exploring S...
Sandeep Swamy
 
BÀI TẬP TEST BỔ TRỢ THEO TỪNG CHỦ ĐỀ CỦA TỪNG UNIT KÈM BÀI TẬP NGHE - TIẾNG A...
Nguyen Thanh Tu Collection
 
Trends in pediatric nursing .pptx
AneetaSharma15
 
UTS Health Student Promotional Representative_Position Description.pdf
Faculty of Health, University of Technology Sydney
 
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
CDH. pptx
AneetaSharma15
 
An introduction to Prepositions for beginners.pptx
drsiddhantnagine
 

Intro javascript build a scraper (3:22)

  • 1. Intro to Javascript: Building a Scraper February 2017 http://bit.ly/thinkful-javascript-scraper
  • 2. About me • Jasjit Singh • Self-taught developer • Worked in finance & tech • Co-Founder Hotspot • Thinkful General Manager
  • 3. About us Thinkful prepares students for web development & data science jobs through 1-on-1 mentorship programs
  • 4. What’s your goal? • Do you want to work better with developers? • Do you want to start working as a developer? • Do you have an idea that you want to build?
  • 5. What’s your programming background? • First lines of code will be written tonight? • Been self teaching for 1-3 months? • Been at this for 3+ months
  • 6. Goals • Javascript overview • Working with HTML • Scraper walkthrough + drills • Email scraping demo
  • 7. Clients / Servers Client Frontend Developer Server Backend Developer
  • 8. What are we learning today? 100% of client-side code (for the web) is written in Javascript. You can also use Javascript to write server- side code thanks to Node.js.
  • 9. History of Javascript • Written by Brendan Eich in 1995 for use in Netscape • Initial version written in just 10 days • Completely unrelated to Java, maybe named after it to draft off popularity • Over 10 years, became default language for browsers
  • 10. Javascript today Javascript is the most common language on Github
  • 11. Also… • Exceptional community of developers, libraries, and frameworks • Great place for beginners to start programming • Lots of job opportunities • Continues to evolve under guidance of Ecma International, with input from top tech companies
  • 12. What is a scraper? A scraper goes around the internet for us and “scrapes” data from websites. Today we’ll make a simple scraper to grab emails from a website.
  • 13. Anatomy of a webpage • HTML - defines content & structure of a page (filename: index.html) • CSS - defines visual presentation of page (filename: index.css) • Javascript - defines behavior of a page (filename: index.js)
  • 15. Using Javascript to interact with HTML We can use Javascript to “grab” an HTML element, store it in a variable and do something with it.
  • 16. What is a variable? A variable is a name that is attached to a value. It gives us a shorthand way to refer to values created in the program //set the variable “x” to “3” var x = 3; //print the variable console.log(x);
  • 17. Things you can assign to a variable • String • Number • Boolean • Null • Undefined • Object • Array
  • 18. Grabbing elements of a certain class //grabs elements with class name “hello world” document.getElementsByClassName(“hello- world”);
  • 19. Starting to put it together //store array of elements in variable “hello” var hello = document.getElementsByClassName(“hello- world”);
  • 20. What is an array? Arrays store multiple values in a single variable: var cars = ["Saab", "Volvo", "BMW"]; Array indexes are zero-based: The first element in the array is 0, the second is 1, and so on. What will this print? console.log(cars[0])
  • 21. Using Javascript to interact with HTML //array of elements with class “hello-world” var hello = document.getElementsByClassName(“hello- world”); //set variable first_item to first item var first_item = hello[0] //print text of first_item console.log(text.textContent)
  • 22. Quick drill Add this to your CodePen HTML <span class=“goodbye”>Goodbye!</span> See if you can use Javascript to print out the text in this element
  • 24. More about Thinkful • Anyone who’s committed can learn to code • 1-on-1 mentorship is the best way to learn • Flexibility matters — learn anywhere, anytime • We only make money when you get a job
  • 25. Our Program You’ll learn concepts, practice with drills, and build capstone projects for your own portfolio — all guided by a personal mentor
  • 26. Our Mentors Mentors have, on average, 10+ years of experience
  • 27. Our Results Job Titles after GraduationMonths until Employed
  • 28. Special Prep Course Offer • Three-week program, includes six mentor sessions • Covers HTML/CSS, Javascript, jQuery, Responsive Design • Option to continue into web development bootcamp • Prep course costs $500 (can apply to cost of full bootcamp) • Talk to me (or email me) about special offer
  • 29. October 2015 Questions? email me at [email protected] or schedule a call through thinkful.com