Studi Kasus Stack - Histori Browser

Fahri Firdausillah
23 Oct 202029:37

Summary

TLDRThis video tutorial covers the implementation of a stack data structure to simulate a browser's history feature. The tutorial demonstrates how to store and navigate URLs using stack operations like push and pop. It also explains parsing and extracting metadata from URLs, including titles and descriptions, using Python libraries. Additionally, the tutorial introduces web scraping techniques with the requests and lxml libraries, showcasing how to create a simple browser-like program that manages back and forward navigation. The video provides a hands-on example for understanding stack usage in real-world applications.

Takeaways

  • πŸ“š The tutorial is about implementing a browser history feature using a stack data structure.
  • πŸ’» The program simulates browser behavior, focusing on history management, including back and forward navigation.
  • πŸ”„ The stack is used to store URLs as the user navigates through them, allowing for back and forward operations.
  • πŸ” The tutorial covers the creation of a stack class with methods like push, pop, and checking the last item without removal.
  • πŸ”’ Emphasis is placed on encapsulation, ensuring that data stored in the stack is private and only accessible through specific methods.
  • 🌐 The tutorial explains how to parse a URL to extract components like scheme, net location, and port, using a Python library.
  • βš™οΈ The script demonstrates how to add URLs to history, navigate back and forward, and display the entire history.
  • πŸ› οΈ A bonus feature is added where the program retrieves and displays metadata like the title and description from a webpage.
  • πŸ“¦ The tutorial makes use of Python libraries such as requests for fetching web content and lxml for parsing HTML.
  • πŸ“ The final part of the tutorial highlights the potential of the program for web scraping and further browser automation.

Q & A

  • What is the main objective of the tutorial described in the script?

    -The main objective of the tutorial is to teach how to implement a stack data structure to simulate browser history navigation, specifically handling back and forward operations.

  • What data structure is used to simulate browser history in the tutorial?

    -The stack (or 'stek' in the script) data structure is used to simulate browser history, allowing the storage and retrieval of URLs in a Last-In-First-Out (LIFO) manner.

  • How does the program handle the 'back' and 'forward' browser actions?

    -The 'back' action pops the last URL from the history stack and moves it to the forward stack. Conversely, the 'forward' action pops the last URL from the forward stack and moves it back to the history stack.

  • Why is encapsulation important in the context of this tutorial?

    -Encapsulation is important because it restricts access to the stack's internal data, ensuring that the data can only be modified using defined methods like push and pop, preventing unauthorized or unintended modifications.

  • What are the two key metadata elements retrieved from a web page in the tutorial?

    -The two key metadata elements retrieved from a web page are the 'title' and the 'description' of the page, which are commonly used to understand the content and purpose of the page.

  • How does the program extract and display the URL metadata?

    -The program uses the `lxml` and `requests` libraries to parse the HTML content of a web page and extract metadata like the title and description, which are then displayed to the user.

  • What is the significance of the `__data` attribute in the stack implementation?

    -The `__data` attribute is a private attribute that stores the stack's elements. Its private status ensures that it can only be accessed and modified through the stack's methods, following the principle of encapsulation.

  • Why does the program not implement a real browser but only simulates the browser history?

    -The program focuses on teaching the stack data structure and its applications rather than building a full-fledged browser, so it only simulates the browser history without rendering actual web pages.

  • What libraries are recommended for more advanced web scraping in Python?

    -For more advanced web scraping, the tutorial suggests using libraries like `BeautifulSoup` for parsing HTML, along with `requests` for fetching web content. For even more complex tasks, tools like `Scrapy` are recommended.

  • What is the purpose of the `Len` function in the stack implementation?

    -The `Len` function in the stack implementation is used to return the number of elements currently stored in the stack, helping to manage and assess the stack's size.

Outlines

00:00

πŸ“š Introduction to Stack and Browser History Simulation

This paragraph introduces the concept of simulating browser history using a stack data structure. The tutorial explains how to create a simple program that mimics the behavior of a web browser's back and forward navigation. The program does not create a real browser but simulates the process by storing URLs in a stack. The introduction also discusses the structure of the program, including how to handle pushing and popping URLs from the stack, and how to ensure the program handles edge cases like empty stacks.

05:01

πŸ”„ Processing and Accessing Data in the Stack

This section delves into the mechanics of how the stack processes and retrieves data. It explains the concept of Last In, First Out (LIFO), where the last item added is the first one processed. The paragraph emphasizes that the stack is designed for processing rather than storing data long-term, and it highlights the importance of encapsulation in object-oriented programming. The example of accessing stack data is given, where the program must follow the correct method to prevent errors.

10:02

πŸ” Parsing URLs and Extracting Metadata

Here, the focus shifts to the process of parsing URLs and extracting relevant metadata. The paragraph explains how the program breaks down a URL into its components, such as the scheme, net location, and path. It introduces the use of Python's urllib library to perform this task and discusses the importance of proper parsing for accurate processing of the URL. Additionally, it mentions how the parsed data is stored and displayed to the user.

15:10

βͺ Implementing Back and Forward Navigation

This paragraph covers the implementation of back and forward navigation within the simulated browser. It discusses how the program saves the state of URLs when navigating backward or forward, ensuring that the correct history is maintained. The paragraph also introduces the logic needed to handle cases where the user attempts to navigate beyond the available history, providing a graceful fallback when the history stack is empty.

20:15

🌐 Fetching and Displaying Web Metadata

In this section, the tutorial expands on the basic simulation by introducing real web requests to fetch metadata from actual URLs. The paragraph explains the use of the requests library to retrieve web pages and the lxml library to parse HTML and extract metadata like the title and description. The paragraph also demonstrates how this data can be fetched and processed, providing a more realistic browser experience, albeit still limited to metadata.

25:18

πŸ”— Advanced Web Scraping Techniques

The final paragraph introduces advanced web scraping techniques for those interested in further expanding the capabilities of the program. It discusses using libraries like BeautifulSoup for more complex parsing tasks and mentions the potential for creating a more sophisticated browser simulator. The paragraph encourages exploring these techniques for more robust data extraction and provides guidance on where to find documentation for further learning.

Mindmap

Keywords

πŸ’‘Stack

A stack is a data structure that operates on a Last-In-First-Out (LIFO) principle, where the most recently added item is the first to be removed. In the video, the stack is used to simulate browser history, allowing the program to store and retrieve URLs as users navigate backward or forward in their browsing sessions.

πŸ’‘History

In the context of the video, 'history' refers to the record of visited URLs in a browser. The history is managed using a stack, where URLs are pushed onto the stack when visited and popped off the stack when navigating backward. This concept is crucial for understanding how the browser simulation keeps track of user navigation.

πŸ’‘URL Parsing

URL parsing involves breaking down a URL into its component parts, such as the scheme (http/https), net location (domain), and path. In the video, URL parsing is used to display a structured description of the URL when a new page is visited, helping users understand the different components of a web address.

πŸ’‘Backward Navigation

Backward navigation allows the user to return to previously visited URLs. In the video, this is implemented by popping the most recent URL off the history stack and displaying the previous one. This function is essential in simulating a real browser's back button.

πŸ’‘Forward Navigation

Forward navigation enables the user to revisit URLs that were previously visited but then navigated away from using the backward function. This is handled by another stack in the video, where URLs are stored when the user navigates backward and retrieved when moving forward again.

πŸ’‘Encapsulation

Encapsulation is an object-oriented programming principle where the internal state of an object is hidden from the outside, only accessible through methods provided by the class. In the video, this concept is demonstrated by using private attributes (e.g., __data) in the stack class, ensuring that the stack’s data can only be manipulated through its defined methods like push and pop.

πŸ’‘Object-Oriented Programming

Object-oriented programming (OOP) is a programming paradigm based on the concept of objects, which contain data and methods. The video showcases OOP principles by defining a stack class with attributes and methods that encapsulate the behavior of a stack, such as storing and retrieving browser history.

πŸ’‘Browser Simulation

The browser simulation in the video is a simplified program that mimics the behavior of a web browser, specifically in managing history through backward and forward navigation. It does not load real web pages but rather simulates the process using a stack to manage the URLs and display their parsed descriptions.

πŸ’‘Metadata Extraction

Metadata extraction in the video refers to the process of retrieving specific information from a web page, such as the title and description. This is done using Python libraries to parse HTML content, which is part of the 'bonus' section where the program is extended to fetch and display real metadata from the web.

πŸ’‘Python Libraries

Python libraries like 'requests' and 'lxml' are used in the video to handle web requests and parse HTML content. These libraries simplify the process of fetching and analyzing web page data, allowing the simulated browser to extract and display metadata like titles and descriptions.

Highlights

Introduction to a tutorial on creating a browser history simulation using the stack data structure.

Explanation of how a stack can be used to simulate a browser's history and navigation functions.

Demonstration of stack implementation in Python, including the creation of basic stack operations like push and pop.

Detailed explanation of the difference between using pop and peek in stack operations.

Illustration of how to manage browser history using stacks for both backward and forward navigation.

Discussion on the encapsulation principle in object-oriented programming (OOP) using the stack class as an example.

Step-by-step guide on building a simple browser simulation with stack-based history management in Python.

Implementation of functions to parse and display URL components such as scheme, net location, and port.

Use of the `urllib.parse` library in Python for URL parsing and extraction of metadata.

Addition of a feature to retrieve and display webpage metadata, such as title and description, using the `requests` and `lxml` libraries.

Demonstration of metadata extraction from actual web pages using Python's `requests` library and HTML parsing techniques.

Example of using the `requests` library to fetch webpage content and `lxml` to parse the HTML structure.

Explanation of the differences between private and public attributes in Python classes, emphasizing data encapsulation.

Conclusion summarizing the tutorial's goal of creating a stack-based browser history simulation and additional features.

Encouragement to explore more advanced web scraping techniques using Python libraries like BeautifulSoup for more complex tasks.

Transcripts

play00:00

Hai assalamualaikum warahmatullahi

play00:00

enggak pertama datang kembali di

play00:02

tutorial ngeremehin menggunakan paytren

play00:04

pada video tutorial kali ini kita akan

play00:07

membahas satu kasus struktur data yaitu

play00:09

kasus step Dika Suspect ini kita akan

play00:14

menerapkan stek atau tumpukan untuk

play00:19

membuat history browser rencananya kita

play00:21

akan membuat program untuk

play00:22

mensimulasikan cara kerja browser.jad

play00:24

tidak membuat brosur kebenaran hanya

play00:26

sekedar jumlah saja dengan ketentuan

play00:28

sebagai berikut ketika program berjalan

play00:30

berjalan pengguna dapat menimbulkan

play00:33

sebagai RL akan berakhirnya kemudian

play00:35

setelah menyebabkan yelprogram akan

play00:37

menampilkan deskripsi dari hotel itu

play00:39

kemunculan itu program juga akan

play00:42

menyimpan tentu Haji RL jadi misalkan

play00:44

pertama masuk dinus.ac.id into the akan

play00:47

disimpan kemudian selanjutnya Kalau kita

play00:50

memilih menu bebek kita akan kembali

play00:52

membuka URL sebelumnya sayurnya nanti

play00:55

jika pengguna memilih menu forward kita

play00:58

bisa membuka

play01:00

RL setelahnya aja setelah Baik nanti

play01:02

bisa forward capek lagi dan seterusnya

play01:05

pengguna dapat melihat semua url yang

play01:07

beriman pada historynya Jadi kalau

play01:09

misalkan kita pilih 10 nanti akan

play01:11

colorstory jadi karena takutnya kita

play01:14

adalah mata kelas struktur data jadi

play01:15

kita enggak membuat browser beneran

play01:17

untuk menampilkan web to bukan kita

play01:20

hanya menampilkan deskripsi dari URL

play01:22

tersebut Tapi nanti sebagai bonusnya

play01:24

kita akan membuka benar-benar buka

play01:27

halaman werel tapi hanya mengambil

play01:29

beberapa metode tajwid akan mengambil

play01:31

berapa metadata sederhana yang

play01:33

kemungkinan besar akan ada di semua

play01:35

halaman web tahun saja kita pertama

play01:38

membuat tipe data stek terlebih dahulu

play01:41

membuat teks bye

play01:51

Hai ini adalah konstruktor nya

play01:57

Hai fungsi yang pertama kali dipanggil

play01:59

ketika stek ini dibuat kemudian ada satu

play02:04

atributnya yaitu Salvador seorang skor

play02:07

data fungsi push kita buat dengan

play02:10

menggunakan Open fungsi pop kita sama

play02:15

menggunakan pop kita akan mengambil data

play02:19

paling akhir diinputkan dengan

play02:21

menggunakan action Nanti kalau habis

play02:23

maka dia akan melakukan return nan kalau

play02:26

tidak seperti ini nanti ketika datangnya

play02:29

habis dan kita tetap melakukan pop jalan

play02:32

keluar error dan perkembangan berhenti

play02:34

Pi kini untuk mengecek data yang

play02:38

terakhir data apa saja tapi tidak

play02:39

langsung dihapus seperti pada pop

play02:42

remaining untuk mengecek semua data yang

play02:45

tersisa

play02:47

Hai dan terakhir adalah fungsi Len untuk

play02:49

menghitung jumlah data di sini datanya

play02:51

saya simpan dalam bentuk eh Lis dengan

play02:55

menggunakan nama variabel underscore

play02:57

underscore data lah dalam ayat 6a

play03:00

variabel dalam class atau nama atribut

play03:04

dalam class jika diawali dengan

play03:05

underscore underscore maka dia sifatnya

play03:07

privat artinya data ini dia tidak akan

play03:11

bisa diakses dari luar kelas selanjutnya

play03:13

kita buat file baru Nah disini kita akan

play03:19

membuat mainnya kita impor dulu steknya

play03:33

mungkin gunakan me in respective

play03:39

Hai gede banget Jupe histo Story sama

play03:45

dengan seks Keke kita coba konsep stek

play03:51

dulu disini jadi eh distek kita bisa

play03:56

menambahkan history pose knia http

play04:06

dinus.ac.id Story pos google.com

play04:21

tokopedia.co.id Sorry remaining history

play04:32

Pop

play04:35

the story and many

play04:44

Hai Hoi harus di pinggir kelihatannya

play05:00

kita jalankan cantik ke pada awalnya di

play05:11

Story remaining ini kita menginputkan

play05:15

tiga alamat yaitu dinus.ac.id google.com

play05:19

tubidy.co.id kemudian kita melakukan pop

play05:21

maka dia akan memproses tokopedia.co.id

play05:25

saya mengatakan pop ini memproses ya

play05:28

bukan menghapus ya Karena tujuan dari

play05:31

stek adalah penyimpanan data untuk

play05:34

Processing bukan penyimpanan data

play05:36

seperti data fisik

play05:38

Hai tekan baterai kram kita akan hanya

play05:40

punya satu jalur kode dalam kiranya

play05:45

punya jalur pada jadi kita hanya bisa

play05:46

memproses satu proses saja tekan terjadi

play05:50

banyak proses urutan kerja yang akan

play05:52

diproses terlebih dahulu itu mana ada

play05:54

kalau kita menggunakan stek maka urutan

play05:56

kerjanya adalah yang diproses paling

play05:58

awal adalah yang ditemukan paling akhir

play06:01

itu maksudnya seperti pohon berarti stek

play06:03

itu untuk menyimpan data agar data nama

play06:06

data mahasiswa gitu simpan kemudian

play06:09

nanti ditampilkan lagi bukan redupkan

play06:12

tujuannya bukan seperti itu tapi kita

play06:14

tes TKD Allah urutan proses urutan

play06:17

prosesnya yang mau diproses seperti yang

play06:19

mau diproses yang mana dulu jadi disini

play06:22

kita sudah memproses tokopedia.co.id

play06:25

awalnya seperti itu kita menampilkan

play06:26

tube.co.id setelah ah Tokopedia kita

play06:30

proses masih ada dua yang belum diproses

play06:33

yaitu dinus.ac.id dan google.com Kenapa

play06:36

saya harus menggunakan email

play06:38

nampak kita tidak langsung menggunakan

play06:40

print history kantor score underscore

play06:43

data saja

play06:48

Hai nah oke kita jelas-jelas disini

play06:53

distek kita punya eh atribut under score

play06:57

underscore tetapi ketika kita

play06:58

mengaksesnya langsung dari main.py

play07:01

historia.co.id telah error oksigen

play07:05

atribut underscore underscore data

play07:06

karena sifatnya underscore underscore

play07:09

data ini private artinya Dia hanya bisa

play07:12

diakses ketika yang fungsinya yang Makes

play07:16

itu ada di dalam plastik itu sendiri

play07:18

kalau dia diakses dari luar kelas

play07:21

misalnya kita disini mengakses dari

play07:23

mencret peyek dia akan dianggap tidak

play07:26

ada ini prinsipnya adalah enkapsulasi

play07:29

nanti bisa dipastikan lebih lanjut

play07:31

Ketika nanti sudah masuk ke mata boleh

play07:33

pemograman berorientasi objek Kenapa

play07:36

saya buatan transfer data karena disini

play07:39

saya memastikan bahwa tag itu hanya bisa

play07:43

diakses dengan cara yang kita inginkan

play07:45

dengan cara inginkan coba yaitu dengan

play07:48

Pools

play07:48

topik reminding dan clean jadi tidak

play07:52

bisa nanti tiba-tiba kita mengakses yang

play07:56

kita memproses yang di tengah itu tidak

play07:59

bisa karena kalau mau proses harus

play08:00

sesuai urutan dengan menggunakan pop ya

play08:04

ini hanya sekedar untuk dicoba aja kita

play08:06

lanjutkan buat browsernya jadi kita ada

play08:09

histori untuk baik dan untuk of forward

play08:13

jadi disini saya tulis baik dan ada

play08:17

forward kita memerlukan state untuk

play08:21

menyimpan dan history kebelakang dan

play08:23

history terbanyak karena kedepannya juga

play08:25

Star ke depan itu juga memprosesnya juga

play08:28

satu-satu ya Mulai dari data yang paling

play08:29

terakhir dan data seterusnya kemudian

play08:32

karena ini nanti akan dipakai

play08:34

berulang-ulang nanti kita seakan buat

play08:36

walkthrough

play08:38

hai hai

play08:40

Hai from OST impor sistem untuk nanti

play08:48

menggunakan sistem clear objek lebih

play08:51

rapi saya buatkan fungsi di atas jadi

play08:56

fungsi ini tidak wajib ya tidak wajib

play08:59

hanya saja biar nanti di dalam mainnya

play09:04

ini tidak terlalu banyak codingan saya

play09:09

pindahkan ke atas ini kalau mau lebih

play09:11

rapi lagi pastinya nanti akan seharusnya

play09:13

kita akan memindahkan ke file yang lain

play09:17

menu

play09:19

Hai mukanya saya masukkan ke dalam

play09:22

inputan menu hebat IV yang diinput

play09:25

dahulu disini kita punya kondisi uh

play09:28

untuk input irlb untuk bakef untuk

play09:30

forward Hah show history dan X untuk

play09:32

loakin instruktur menunya UBS biar

play09:38

enggak error saya kasih pas semua dulu

play09:45

di Indonesia lanjutnya kita mulai dari

play09:53

yang di hutan menu kalau dipilih noh

play10:02

Mekkah kita akan menginputkan url-nya

play10:05

apa kemudian mau di Tampilkan deskripsi

play10:08

deskripsi yang saya maksud disini adalah

play10:10

struktur dari Earth sendiri RL itu

play10:13

tolong siapkan http2 dinus.ac.id Yaitu

play10:16

terdiri apa saja ada game skemanya ada

play10:20

bisa http bisa ttps net location itu

play10:23

berarti diri saja gede itu locationnya

play10:27

port-nya itu berapa default-nya 80

play10:29

harusnya tesnya itu yang terletak

play10:31

setelah net location jadi jalan dinus.ac

play10:35

gede flash articles list detail itu

play10:37

Misalkan adalah nya sedangkan Polri itu

play10:40

kalau misalkan ada q = 5 itu adalah

play10:45

Hai warungnya saya akan menampilkan ini

play10:48

untuk menampilkan ini semua saya akan

play10:50

menggunakan library yang ada pada

play10:53

paytren yaitu biar Alphard G

play11:00

hai hai

play11:02

ini dia akan eh dia akan membaca url

play11:11

yang bisa disembuhkan kemudian akan

play11:13

menghasilkan parkir er nanti yang parkir

play11:15

Eli nanti yang akan dipecah pecah skema

play11:18

dan lain sebagainya kini variabel untuk

play11:23

Extraction nya jadi skema itu kita ambil

play11:26

dari URL skemp

play11:29

Hai atau jika tidak ada maka default-nya

play11:32

adalah http biasanya antara DDP atau

play11:35

ttps port-nya port-nya default-nya

play11:38

adalah 80 jika ada potnya maka dia 80

play11:42

jika potnya diinputkan maka dia akan

play11:44

mengikuti port nya berapa kalau misalkan

play11:47

Anda port-port lain kadang-kadang eh ada

play11:51

website yang menyediakan untuk port-port

play11:53

yang lain kemudian net location itu dia

play11:57

akan mengambil dari netlog kecuali kalau

play12:00

networknya tidak ada maka dia akan

play12:02

mengambil dari part

play12:05

Hai dan sebaliknya kalau pas nyatanya

play12:07

bebasnya kosong ini facenya si r l sama

play12:16

kabelnya sudah pasti lele oke oke kita

play12:22

coba dulu

play12:25

Hai angkutan

play12:27

Hai kalau kita input kan yang lain dia

play12:30

enggak akan selesai uh input qrl ini

play12:35

saya akan http dinus.ac.id Ours ada yang

play12:44

kelupaan setelah else kita tambahkan

play12:50

input biar nanti dia tak langsung tutup

play12:54

Hai laki-laki nah kelas dulu editor

play13:02

sakiti skemanya adalah TTP lokasinya

play13:05

adalah nasehat dari di depoknya lapan

play13:07

puluh

play13:09

hai hai

play13:11

hai hai

play13:14

Hai Sedangkan ini kulino kesini ya ya

play13:23

skemanya adalah TPS locationnya kulino

play13:26

port-nya lawan puluh petnya course.you

play13:31

tidak HP ini adalah fans-nya query nya

play13:33

Ed = 6316 ini belum bisa keluar ya bisa

play13:41

keluar Saya pakai control D dulu

play13:47

the lounge keluarnya ini saya

play13:50

menyaksikan luarnya di sini oke nanti

play13:53

kalau kita pencet X nanti dia akan

play13:54

hampir semua kembali dan exit

play13:59

selanjutnya kita mengimplementasikan

play14:00

fungsi baknya Oh ya Eh tadi kita masih

play14:05

belum menyimpan url-nya ya harus telah

play14:08

berhasil tampil itu kita simpan dengan

play14:10

menggunakan stek.com yel-yelnya kita

play14:18

simpan pada history

play14:21

Hai selanjutnya ketika kita mengambil

play14:26

bebek maka url-nya itu kita ambil dari

play14:32

history teh.com kemudian dia relnya kita

play14:39

parsing lagi kerjanya sangat persis

play14:42

seperti ini karena saya enggak mau nulis

play14:44

banyak jadi sebaiknya ini saya pindah ke

play14:49

fungsi ada hebat fungsi f parts url r&d

play15:10

disini Saya cukup manggilnya adalah

play15:15

parsi er

play15:21

sama tidak berarti di sini sama juga

play15:24

nggak perlu bikin lagi parsi url

play15:27

kemudian kalau kita backup history for

play15:31

what nya juga harus kita simpan kalau

play15:32

kita baik maka history formatnya kita

play15:35

simpan forward

play15:43

hai hai

play15:44

Hai Nah tadi nanti kemungkinan kalau

play15:48

kita sudah melakukan Fit sampai akhir

play15:50

nanti kan history baiknya akan kosong

play15:52

nih seharusnya akan kosong Kalau

play15:54

tarifnya akan kosong kita kasih

play15:56

pernyataan saja seperti if you at El

play16:00

Isnan nanti dia akan ngeprint

play16:06

hai biz.top oriflek kosong belum ada

play16:14

isinya hells baru kalau kan ini

play16:20

Hai Elsword kita lakukan ini selanjutnya

play16:24

yang forward juga forward itu seharusnya

play16:29

juga hampir sama seperti ini jadi saya

play16:31

cop tips aja duit bukan menggunakan bak

play16:35

pop tapi sport word Pop

play16:39

Hai sorry forward kosong parsi RL sama

play16:46

setelah kita forward ini pasnya belum

play16:50

dihapus setelah kira forward itu

play16:54

historynya juga kekasih Man kita Balikin

play16:57

ke BAK sebaliknya jadi teh modern

play17:01

sekarang saja karena ini sederhana haid

play17:04

untuk menampilkan Semua history history

play17:06

kita punya dua history disini yaitu

play17:08

history badan history for word maka

play17:10

disini kita Tuliskan keduanya print baik

play17:19

remaining plus forward semen oke

play17:30

Hai masih kosong mereka masih kosong

play17:37

jauh Story juga masih kosong input drl

play17:41

kita input kan drl dulu https di

play17:46

Indonesia Tercinta Titin kita masukkan

play17:51

juga yang boleh no Oke kita masukkan

play17:56

Yazid live Oke kalau kita lihat

play18:00

historynya kita sudah punya history ini

play18:04

Hai saya pengen baik maka kalau di bebek

play18:07

itu yang pertama kita ambil adalah dari

play18:09

kitab Dea coba baik nah keluar kitabnya

play18:13

baik lagi mau belum infek lagi sekarang

play18:18

ke kulino baik lagi di dinus.ac.id baik

play18:24

lagi Story kosong forward

play18:30

Hai pancen salah disini diwaktu kita

play18:33

copy page spacenya enggak hilang masalah

play18:38

dikit sini bareng lagi kulino masuk

play18:45

pertama kemudian input lagi gitlabs

play18:54

Hai Oke kita lihat historynya ada ini

play18:58

kalau saya pek haiten yang terakhir

play19:02

masukkan lebih baik lagi kejut lab saya

play19:06

forward cat lagi karena tadi barusan

play19:10

diperluakan dari baik dengan sangat ke

play19:12

dalam forward forward lagi ke Paiton

play19:15

lagi

play19:17

I hope sword lagi kosong dek ke paytren

play19:23

baik kejut life-cycle kulino baik lagi

play19:28

kosong Kalau di history dia masih tetap

play19:31

karena history ini kita buat tadi dia

play19:33

menyimpan for back dan forward jadi

play19:36

apapun yang tersimpan di badan forward

play19:39

ini dia akan semua tampil di sini

play19:45

I make jadi ah kita sudah berhasil

play19:50

mengimplementasikan stek untuk history

play19:54

back dan forward pada browser abal-abal

play19:58

ini sekarang kita kita tadi cuman

play20:02

menampilkan deskripsinya parkire Lini

play20:04

seharusnya Nggak cukup lagi masak cuman

play20:06

menampilkan deskripsi saja seharusnya

play20:08

kita mengambil minta dia nih kita masuk

play20:15

ke Bonus kita benar-benar membuka

play20:17

halaman url tapi hanya mengambil Brown

play20:19

tapi harta saja tapi bukan menampilkan

play20:22

semua isinya web Disini saya akan

play20:25

menggunakan

play20:28

Hai Februari piton yang sudah banyak

play20:30

tersedia di internet kita nggak perlu

play20:32

bikin ulang dari awal untuk membuka web

play20:35

itu kita menggunakan frequensee seledri

play20:40

request parsing html kita menggunakan

play20:43

lxml HTML ada yang lebih bagus

play20:48

Sebenarnya ada yang lebih muda

play20:50

sebenarnya pakainya beautifulsoup tapi

play20:53

disini saya menggunakan yang reaksi

play20:54

kacer menggunakan HTML untuk yang

play20:57

request ini kita mungkin perlu melakukan

play21:01

pipe install request kalau pertama kali

play21:10

install python dan belum pernah

play21:12

menggunakan eh request Kita harus

play21:16

melakukan tipe ini dulu di sini

play21:19

t-shirt Alya Kalau di tempat saya ini

play21:23

sudah ada jadi

play21:28

Hai kyup belakangnya

play21:32

Hai caranya cari di tempat saya sudah

play21:35

ada dia keluar ikut Warman already

play21:38

speech tapi kalau belum ada nanti dia

play21:39

akan ada download dari internet

play21:42

menggunakan t-cash Oke selanjutnya eh

play21:49

Hai selanjutnya saya buat fungsi laki

play21:51

bukan porsi RL tapi gempar di RL tapi

play21:55

menggunakan Open url er Apa yang akan

play22:06

kita metadata apa yang akan kita buka di

play22:08

sini eh hampir selalu ada di setiap bab

play22:13

site ini contohnya dipiten di kulino

play22:19

digit lab itu kalau kita view page

play22:24

source ya Ada pertama dia selalu ada

play22:27

title title ini meternya Vettel ini dia

play22:33

yang muncul di atas ini Welcome to

play22:35

python.org ini adalah title yang kedua

play22:38

adalah description description itu

play22:40

deskripsi dari halaman ini untuk

play22:42

dikenali Google itu apa official home

play22:44

page of Python programming language gitu

play22:47

jadi kulino

play22:48

Hai ada tolnya ada di atas sini kuliah

play22:53

online Udinus descriptionnya kulino

play22:57

merupakan learning Februari blablablabla

play23:00

sedangkan dijiplak vitalnya adalah The

play23:06

First single application for interior

play23:07

case of description nya neng description

play23:12

ini ada yang description Twitter

play23:14

description property description ngada

play23:18

from Project planning blablablablabla

play23:19

ada yg menjadi semuanya hampir semua web

play23:22

itu memiliki dua komponen ini ya oke

play23:25

sebelum kita membuat programnya Saya

play23:27

tunjukkan dulu Bagaimana cara kerja

play23:30

paytren requestnya dan three sport

play23:35

request jadi kalau kita manggil ini

play23:42

paytren request

play23:44

Hai http.get uikit siaran menampilkan

play23:51

response 20 saja

play23:54

a response 200jta mengambilkan objek

play23:58

dengan representasi respons 200 Artinya

play24:01

kita sudah berhasil mengambil data dari

play24:03

instagram.id saya cuman ke dalam

play24:06

variabel lemahnya Rush

play24:09

Hai pagi terus

play24:16

Hai Konawe ponsel dosa2 kita ambil

play24:20

konten nah ini konten yang kita dapatkan

play24:23

html Adobe buahnya sebanyak ini

play24:27

Hai ini kalau tidak mau dapatkan

play24:28

semuanya kita tidak mungkin menampilkan

play24:32

ini pada command prompt karena akan

play24:33

kepanjangan nantinya makanya dari Rest

play24:36

content in tadi hasil konten kita

play24:38

dapatkan nanti kita akan memparsing

play24:40

dengan menggunakan HTML yang ada dari

play24:42

lxml untuk mengambil title dan eh untuk

play24:48

mengambil Wetan dan Meta deskripsi saja

play24:51

lo lagi kepingin kita Rush sama dengan

play24:58

request RL kemudian ke dalam prosesor

play25:05

html html forms from string tasimpan

play25:10

html three diparaf oleh menteri kita

play25:15

cetak

play25:18

Hai di sini kita cetak

play25:25

Hai kacetak Paito dan kita Meta

play25:30

description metalnya itu kita rekannya

play25:37

itu kita parsing dari html3 expert kita

play25:40

ambil yang teksnya title

play25:44

Hai teks kemudian yang metal description

play25:48

juga

play25:50

Hai Meta description kita ambil dari

play25:52

html3 expert kita cari yang komponen

play25:56

Meta dan namanya adalah description kita

play25:58

ambil kontaknya Oke sudah semua sekarang

play26:02

kita gantiang parsi RL ini kita ganti

play26:06

jadi oven

play26:12

hai hai

play26:16

Oh Ya sepertinya sudah semua kita coba

play26:30

jalankan lagi url http uniqdeal

play26:37

Hai Timnas tergede keluar ya keluar

play26:41

vitalnya dalonzo Nuswantoro Genting Kra

play26:44

aktivitas ia kita hahaha

play26:54

Kyle laki citrate keluar ini titelnya

play26:59

for single application for blablabla dan

play27:02

ini adalah descriptionnya promotion

play27:05

blablablablabla kita ambil lagi yang

play27:12

memungkinkan lagi untuk yang Fighter

play27:15

keluar kebaikan road officer of wedding

play27:19

makeup dikalahkan bak keluar lagi for

play27:24

watching word dan seterusnya jadi itu

play27:31

yang sudah kita buat kita buat browser

play27:35

sederhana yang menyimpan data history di

play27:37

black dan forward dengan menggunakan

play27:39

stek jadi ini adalah Allah atau

play27:41

implementasi step dimana kita menyimpan

play27:44

eh menyimpan history browser jadi

play27:48

misalkan di sini ya kita memarkan 8 ini

play27:51

baik-baik forward forward forward

play27:53

ekor batiknya itu datanya di Iman di

play27:57

dalam stek dengan menggunakan ini

play27:59

penyimpanannya dan cara seperti ini

play28:01

selanjutnya di ini saya setel

play28:03

mencontohkan beberapa hal yang tidak ada

play28:07

di perkuliahan ya bentrokan ini saya

play28:10

mengambil url pars nanti bisa dicari di

play28:12

paytren di Eropa sini menampilkan apa

play28:14

aja kemudian request ini untuk mengambil

play28:18

data dari website cari di Google paytren

play28:22

request studia dokumentasinya ngapain

play28:24

aja ini biasa digunakan untuk scripping

play28:28

atau kalau misalkan kita membuat browser

play28:30

mini nanti dengan menggunakan gue

play28:31

keluarnya benar-benar tampilan web Kita

play28:34

juga bisa menggunakan seperti ini

play28:35

kemudian from Mein kabse lanjutnya untuk

play28:37

wasting htmlnya kita menggunakan lxml

play28:40

dan html kalau pengen tahu bagaimana

play28:43

cara mengambil komponen-komponen HTML

play28:46

dari lxml ini bisa cari di

play28:49

dokumentasinya juga pakai Kernel xml

play28:51

html menggabungkan

play28:53

yang antara request dan head timeline

play28:56

biasa-biasa digunakan untuk skretting

play28:57

atau mengambil sebagian data dari web

play29:00

secara otomatis ada yang lebih canggih

play29:03

lagi untuk saja ini sangat bersih sekali

play29:05

kalau mau yang lebih canggih lagi ada

play29:07

bisa pakai vectorscribe dan menggunakan

play29:10

Speedy full sub tuh bisa aja lebih

play29:13

canggih lagi Oke cukup sampai disini

play29:16

Semoga dapat dipahami Semoga bisa

play29:19

bermanfaat kalau masih ada yang kurang

play29:21

paham bisa diulang lagi videonya

play29:23

berhenti di tempat-tempat yang kurang

play29:27

dipahami kemudian kalau masih belum

play29:29

habis adibet lagi dan seterusnya kalau

play29:31

masih ada pertanyaan silahkan dituliskan

play29:32

di kolom komentar dan dari saya selama

play29:35

alaikum warahmatullah barakatuh

Rate This
β˜…
β˜…
β˜…
β˜…
β˜…

5.0 / 5 (0 votes)

Related Tags
Python ProgrammingStack ImplementationBrowser SimulationWeb ScrapingMetadata ExtractionCoding TutorialData StructuresObject-OrientedProgramming ConceptsWeb Development