CyberCode Academy

CyberCode Academy

Welcome to CyberCode Academy — your audio classroom for Programming and Cybersecurity. 🎧 Each course is divided into a series of short, focused episodes that take you from beginner to advanced level — one lesson at a time. From Python and web development to ethical hacking and digital defense, our content transforms complex concepts into simple, engaging audio learning. Study anywhere, anytime — and level up your skills with CyberCode Academy. 🚀 Learn. Code. Secure. You can listen and download our episodes for free on more than 10 different platforms: https://linktr.ee/cybercode_academy

  1. 18 hr ago

    Course 40 - Web Scraping with Python | Episode 22: Mastering Tree Traversal, CSS Selectors, and XPath

    In this lesson, you’ll learn about: precision data extraction using advanced tree traversal, powerful CSS selectors, and XPath navigation for handling even the most complex web structures1. Advanced Tree Traversal (Beyond Basics)🔹 Navigating the HTML “Family Tree”Instead of just searching, you move through the structure intelligently.🔹 Key Navigation Methodstag.find_parent() tag.find_next_sibling() tag.find_next() tag.find_all_next() 🔹 What Each Does find_parent() → move upwardfind_next_sibling() → next element at same levelfind_next() → next matching element anywhere afterfind_all_next() → all matches after current point👉 Key Insight Traversal lets you start anywhere and still reach your target2. CSS Selectors (Soup Sieve Power)🔹 Modern, Flexible SelectionBeautiful Soup supports CSS selectors via Soup Sieve.🔹 Basic Syntaxsoup.select("div.classname") soup.select("#main") soup.select("ul > li") 🔹 Selector Types #id → specific element.class → group of elementsA > B → direct children onlyA B → any nested descendants🔹 Sibling Selectorssoup.select("h2 + p") # next sibling soup.select("h2 ~ p") # all following siblings 👉 Key Insight CSS selectors are often cleaner and more readable than manual navigation3. Attribute Matching in CSS🔹 Targeting Dynamic Datasoup.select('a[href^="https"]') soup.select('img[src$=".png"]') soup.select('a[href*="example"]') 🔹 Matching Types ^= → starts with$= → ends with*= → contains👉 Key Insight Perfect for scraping dynamic or partially known values4. XPath Navigation (Precision Mode)🔹 Path-Based TargetingXPath works like navigating folders:🔹 Examples# Absolute path /html/body/div[1]/a # Global search //a # Attribute filtering //a[@href="example.com"] # Indexing (//a)[1] 🔹 Key Features Navigate from root or anywhereFilter by attributesSelect exact index👉 Key Insight XPath is the most precise but strict method5. CSS vs XPath vs TraversalMethodStrengthBest UseTraversalFlexibleDynamic navigationCSS SelectorsReadableMost scraping tasksXPathPreciseComplex structures6. Combining Techniques🔹 Real Power Comes from MixingExample workflow: Start with CSS selectorNavigate with traversalRefine with XPath👉 Key Insight No single method is enough for all cases7. Mental ModelThink like this: 🧭 Traversal → move through structure🎯 CSS → quickly target patterns🔬 XPath → pinpoint exact elementsFinal TakeawayAt this level, scraping becomes surgical precision engineering.You are no longer guessing where data is—you are: Navigating directly to itSelecting it with intentExtracting it efficiently👉 With traversal + CSS + XPath, you can handle any web structure, no matter how complex You can listen and download our episodes for free on more than 10 different platforms: https://linktr.ee/cybercode_academy

    Course 40 - Web Scraping with Python | Episode 22: Mastering Tree Traversal, CSS Selectors, and XPath
  2. 1 day ago

    Course 40 - Web Scraping with Python | Episode 21: Mastering XML Parsing and Advanced Search with Beautiful Soup and XPath

    In this lesson, you’ll learn about: how XML and XPath enable precise data navigation, and how to use advanced Beautiful Soup techniques for highly targeted extraction from complex documents1. XML as a Data Structure🔹 Why XML Matters🔹 Key Characteristics Designed for data transfer, not displayStrict and well-formedHighly structured and predictable👉 Key Insight XML is ideal for scraping because its structure is consistent and machine-friendly2. Parsing XML with LXML🔹 Turning XML into a Treefrom bs4 import BeautifulSoup soup = BeautifulSoup(xml_data, "xml") 🔹 Why Use LXML Fast parsingHandles large structured dataWorks seamlessly with XPath3. XPath: Precision Navigation🔹 Query Language for TreesXPath works like a file system path:# Example concept /html/body/div[1]/a 🔹 What XPath Can Do Select nodes by locationFilter by attributesNavigate deep hierarchies👉 Key Insight XPath gives you surgical precision in large documents4. Limiting Search Results🔹 Control Output Sizesoup.find_all("item", limit=5) Returns only first N matches👉 Why It Matters Improves performanceUseful for testing and sampling5. Controlling Search Depth🔹 Recursive vs Non-Recursivesoup.find_all("div", recursive=False) True (default) → searches entire subtreeFalse → only direct children👉 Key Insight Restricting depth = faster + more accurate queries6. Handling Custom Attributes🔹 Attributes with Special Namessoup.find_all(attrs={"extra-info": "value"}) 🔹 Why This Matters Handles data-* and hyphenated attributesAvoids Python keyword conflicts👉 Key Insight attrs unlocks full flexibility in attribute filtering7. Text-Based Extraction🔹 Targeting Content Directlysoup.find_all(string="Example Text") 🔹 Pattern Matchingimport re soup.find_all(string=re.compile("Example")) 👉 Key Insight You can search by content, not just structure8. Custom Function Filters🔹 Complex Logic Extractiondef single_text_child(tag): return tag.string is not None soup.find_all(single_text_child) 👉 Why This Is Powerful Enables advanced conditionsFully customizable filtering9. Combining Techniques (Real Power)🔹 Full Precision ExtractionYou can combine: XPath for structurefind_all() for discoveryAttribute filtersText filtersCustom logic10. Mental ModelThink of advanced parsing as: 🧭 XPath → exact location🔍 BeautifulSoup → flexible search🧠 Filters → smart decision logicFinal TakeawayAt this stage, scraping becomes precision engineering rather than simple extraction.You are now able to: Navigate deeply nested structuresControl search scope and performanceExtract exactly what you need with minimal noise👉 This is what separates basic scraping from professional-grade data parsing You can listen and download our episodes for free on more than 10 different platforms: https://linktr.ee/cybercode_academy

    Course 40 - Web Scraping with Python | Episode 21: Mastering XML Parsing and Advanced Search with Beautiful Soup and XPath
  3. 3 days ago

    Course 40 - Web Scraping with Python | Episode 20: XPath Fundamentals and Advanced Beautiful Soup Searching

    In this lesson, you’ll learn about: how Beautiful Soup works with both HTML and XML, how XPath enhances tree navigation, and how to perform precise, high-performance searches using advanced filtering techniques1. HTML vs XML in Web Scraping🔹 Understanding the Difference🔹 Key Concepts HTML → designed for display (messy, flexible)XML → designed for data (strict, structured)👉 Key Insight XML is predictable → HTML is not2. Parsing XML with Beautiful Soup🔹 Using LXML Parserfrom bs4 import BeautifulSoup soup = BeautifulSoup(xml_data, "xml") 🔹 Why LXML? FastHandles both HTML & XMLWorks well with large datasets3. XPath (Advanced Navigation)🔹 Querying the TreeXPath allows you to: Navigate by exact pathFilter by attributesTarget deeply nested elements👉 Key Insight XPath = precision targeting in complex trees4. Limiting Search Results🔹 Controlling Output Sizesoup.find_all("a", limit=3) Returns only first N matches👉 Key Insight Useful for performance + sampling data5. Non-Recursive Searches🔹 Restricting Scopesoup.find_all("div", recursive=False) Searches only direct childrenAvoids deep traversal👉 Key Insight Improves speed and accuracy in large documents6. Attribute-Based Filtering🔹 Using attrs Dictionarysoup.find_all(attrs={"data-id": "123"}) 🔹 Why Use attrs? Handles special characters (data-*)Avoids keyword conflicts (name, class)👉 Key Insight attrs gives full control over attribute filtering7. Text-Based Searching🔹 Finding Specific Textsoup.find_all(string="Hello World") 🔹 Match by Patternimport re soup.find_all(string=re.compile("Hello")) 👉 Key Insight You can target content—not just tags8. Custom Function Filters🔹 Advanced Logicdef only_text(tag): return tag.string is not None soup.find_all(only_text) 👉 Key Insight Custom filters = maximum flexibility9. Real-World Precision Extraction🔹 Combining TechniquesYou can combine: XPath / structureAttribute filtersText filtersCustom logic10. Mental ModelThink of advanced scraping like: 🎯 XPath → sniper precision🔍 find_all → search engine🧠 filters → decision logicFinal TakeawayAt this level, scraping becomes surgical instead of exploratory.You are no longer just finding data—you are:👉 targeting exact nodes 👉 limiting scope for performance 👉 combining filters for precisionThat’s what transforms scraping into a high-performance data extraction system. You can listen and download our episodes for free on more than 10 different platforms: https://linktr.ee/cybercode_academy

    Course 40 - Web Scraping with Python | Episode 20: XPath Fundamentals and Advanced Beautiful Soup Searching
  4. 4 days ago

    Course 40 - Web Scraping with Python | Episode 19: Tree Navigation, Advanced Filtering, and Link Extraction

    In this lesson, you’ll learn about: advanced Beautiful Soup navigation, powerful filtering techniques, and how to extract and normalize real-world data like links from complex websites1. Advanced Tree Navigation🔹 Multi-Directional MovementBeautiful Soup allows you to move through HTML in three different dimensions:🔹 Vertical Navigationlist(tag.children) list(tag.descendants) tag.parent tag.parents .children → direct children only.descendants → all nested elements.parent / .parents → move upward👉 Key Insight .children is shallow — .descendants is deep traversal🔹 Sideways Navigation (Siblings)tag.next_sibling tag.previous_sibling Moves across elements at the same level🔹 Chronological Navigation (Parser Order)tag.next_element tag.previous_element Follows actual parsing sequenceCan move into text, nested tags, or out of structure👉 Key Insight next_element ≠ next_sibling It follows document order, not hierarchy2. Advanced Filtering Techniques🔹 Precision Data Targeting3. Filtering with Regular Expressionsimport re soup.find_all(re.compile("^p")) Matches tags starting with "p"Useful for pattern-based selection4. Filtering with Attributessoup.find_all("a", class_="nav") soup.find_all("div", id="main") soup.find_all("img", src=True) class_ → avoids Python keyword conflictsrc=True → finds elements that have the attribute👉 Key Insight You can filter by value OR existence of attributes5. Custom Function Filters (Power Feature)def has_src_no_href(tag): return tag.has_attr("src") and not tag.has_attr("href") soup.find_all(has_src_no_href) 👉 Key Insight Custom functions = unlimited filtering logic6. Real-World Example: Link Extraction🔹 Extracting Links from a Page🔹 Extract All Linkslinks = soup.find_all("a") for link in links: print(link.get("href")) 7. Relative vs Absolute URLsTypeExampleRelative/aboutAbsolutehttps://site.com/about🔹 Convert to Absolutebase = "https://example.com" full_url = base + relative_url 👉 Key Insight Most websites use relative links → you must normalize them8. Extracting All Resource Links# Anchor links soup.find_all("a") # Stylesheets / metadata soup.find_all("link") # Images soup.find_all("img") 👉 Key Insight Data isn’t only in tags — it's everywhere9. Mental ModelThink of advanced scraping as: 🧭 Navigation → move through tree🎯 Filtering → select exactly what you want🔗 Extraction → collect and normalize dataFinal TakeawayAt this level, Beautiful Soup becomes more than a parser—it becomes a data navigation engine.Once you master: Deep traversal (descendants, parents)Smart filtering (regex + functions)Real-world normalization (links, resources)👉 You can extract any structured data from any HTML document, no matter how complex. You can listen and download our episodes for free on more than 10 different platforms: https://linktr.ee/cybercode_academy

    Course 40 - Web Scraping with Python | Episode 19: Tree Navigation, Advanced Filtering, and Link Extraction
  5. 5 days ago

    Course 40 - Web Scraping with Python | Episode 18: Mastering HTML Parse Tree Navigation and Element Extraction with Beautiful Soup

    In this lesson, you’ll learn about: how Beautiful Soup builds a navigable HTML tree, how to search and filter elements, and how to move through the structure to extract clean, structured data1. Parsing HTML with Beautiful Soup🔹 From Raw HTML → Structured Tree🔹 Basic Workflowimport requests from bs4 import BeautifulSoup html = requests.get("https://example.com").text soup = BeautifulSoup(html, "lxml") 🔹 Visualizing the Structureprint(soup.prettify()) 👉 Key Insight Beautiful Soup turns messy HTML into a clean tree structure2. Core Elements of the Parse Tree🔹 The 4 Building Blocks🔹 Key Components Tags → HTML elements (, )Attributes → stored as dictionariesNavigableString → text inside tagsComments → hidden HTML notes🔹 Exampletag = soup.a tag.attrs tag.string 👉 Key Insight Everything in HTML becomes an object you can navigate3. Searching & Filtering Elements🔹 Finding Data Efficiently🔹 Common Methodssoup.title soup.find("div") soup.find_all("a") 🔹 Using Regeximport re soup.find_all("a", href=re.compile("example")) 👉 Key Insight find_all() is your main tool for scalable extraction4. Navigating the HTML Tree🔹 Directional Navigation5. Moving Down the Treesoup.body.contentsAccess childrenIterate through nested elements6. Moving Up the Treetag.parentMove to parentAccess ancestors7. Moving Sidewaystag.next_sibling tag.previous_siblingAccess elements at same level👉 Key Insight Scraping = navigating the tree in the right direction8. Extracting Clean Data🔹 Practical Extraction🔹 Example: Extract Table Datafor row in soup.find_all("tr"): cols = row.find_all("td") data = [col.text.strip() for col in cols] 👉 Key Insight .text + .strip() = clean usable data9. Mental ModelThink of BeautifulSoup as:🌳 A tree🔍 find() = search tool🧭 navigation = movement (up/down/sideways)Final TakeawayBeautiful Soup transforms web scraping from:❌ guessing text patterns ➡️ into ✅ navigating structured dataOnce you understand:Tree structureSearch methodsNavigation directions👉 You gain full control over extracting any data from any HTML page You can listen and download our episodes for free on more than 10 different platforms: https://linktr.ee/cybercode_academy

    Course 40 - Web Scraping with Python | Episode 18: Mastering HTML Parse Tree Navigation and Element Extraction with Beautiful Soup
  6. 6 days ago

    Course 40 - Web Scraping with Python | Episode 17: Mastering Requests, Regex, and Beautiful Soup

    In this lesson, you’ll learn about: how Python retrieves web pages, how regex is used for pattern-based extraction, and how BeautifulSoup improves scraping by understanding HTML structure instead of treating it as plain text1. Fetching Web Content in Python🔹 HTTP Request FlowWeb scraping always starts with getting the page content.🔹 Libraries Used urllib → built-in, basic controlhttplib2 → low-level controlrequests → easiest and most popular🔹 Requests Exampleimport requests response = requests.get("https://example.com") html = response.text 🔹 User-Agent HandlingSome sites block bots, so you can:headers = {"User-Agent": "Mozilla/5.0"} requests.get(url, headers=headers) 👉 Key Insight Without proper headers, many sites will reject your scraper2. Regular Expressions (Regex Basics)🔹 Pattern Matching ConceptRegex treats web data as raw text patterns.3. Core Regex FunctionsFunctionBehaviormatch()checks start onlysearch()finds first match anywherefindall()returns all matches🔹 Special SymbolsSymbolMeaning\ddigits\wletters + numbers\swhitespace🔹 Example Patternimport re re.findall(r"\d+", "Price is 123 dollars") 👉 Key Insight Regex is powerful but fragile for HTML4. Advanced Regex Techniques🔹 Ranges & Groups [A-Z] → uppercase letters{3} → exact repetition( ) → capture groups🔹 Example: Extract Namesre.search(r"(\w+) (\w+)", "John Smith") 5. Real Web Scraping Use Cases🔹 Inspecting HTMLUsing browser tools, you can locate: items, headerscontact detailslocation data🔹 Example Targets Phone numbersZip codesCity/state data6. BeautifulSoup (Structured Parsing)🔹 DOM-Based ApproachBeautifulSoup understands HTML as a tree structure, not text.🔹 Basic Usagefrom bs4 import BeautifulSoup soup = BeautifulSoup(html, "lxml") print(soup.title.string) 🔹 Key Advantage Navigates tags easilyHandles broken HTMLCleaner extraction than regex7. Parsers (LXML vs HTML5lib)ParserStrengthlxmlfasthtml5libvery forgiving👉 Key Insight Parser choice affects speed vs accuracy8. Regex vs BeautifulSoupFeatureRegexBeautifulSoupStructure aware❌✔️Speed✔️MediumReliability❌✔️9. Mental ModelThink of scraping like: 📥 Requests → download page🔍 Regex → pattern hunting🌳 BeautifulSoup → structured navigationFinal TakeawayWeb scraping becomes powerful when you stop treating HTML as text and start treating it as a structured tree of data.👉 Use: Requests → fetchRegex → quick patternsBeautifulSoup → real extractionThat combination covers most real-world scraping tasks. You can listen and download our episodes for free on more than 10 different platforms: https://linktr.ee/cybercode_academy

    Course 40 - Web Scraping with Python | Episode 17: Mastering Requests, Regex, and Beautiful Soup
  7. 26 Jul

    Course 40 - Web Scraping with Python | Episode 16: Mastering Data Extraction with Beautiful Soup

    In this lesson, you’ll learn about: how web scraping works end-to-end, why fetching and parsing are the two core stages, and how different tools like Regex, BeautifulSoup, and Scrapy compare in real-world data extraction1. What is Web Scraping?🔹 Core IdeaWeb scraping = automated data extraction from websitesInstead of manually copying data, a program: Visits a pageReads the HTMLExtracts structured information2. Two-Phase Scraping Workflow🔹 Overall PipelinePhase 1: Fetching Content Send HTTP request (GET)Receive HTML responseStore raw page contentTools: Requestsurllibhttplib2Phase 2: Parsing & Extraction Analyze HTML structureExtract required dataClean results3. Regex vs Structured Parsers🔹 Regular ExpressionsRegex: Works on text patternsFast but fragileBreaks easily on messy HTML👉 Key Insight HTML is not flat text—it’s structured data4. BeautifulSoup (Structure-Aware Parsing)🔹 Why It Works BetterBeautifulSoup: Understands HTML tree structureFixes broken markupLets you navigate elements easily🔹 Key AdvantageInstead of guessing text patterns:👉 you navigate the DOM like a tree5. HTML vs DOM ParsingTypeDescriptionHTML parsingRaw server outputDOM parsingRendered browser structure🔹 Important Difference HTML = static snapshotDOM = live, updated by JavaScript6. Static vs Dynamic Content🔹 Static Pages Easy to scrapeNo JavaScript requiredBeautifulSoup works well🔹 Dynamic Pages Content generated by JavaScriptRequires browser renderingTools: SeleniumScrapyHeadless browsers👉 Key Insight If data appears after page load → you need a browser engine7. Advanced Tools Overview🔹 Scrapy (Industrial Tool) Built for scaleHandles crawling + pipelinesUsed for production systems🔹 Selenium Controls real browserHandles JavaScriptSlower but powerful🔹 Computer Vision Scraping (Sikuli) Reads screen pixelsWorks without HTMLUsed when UI has no accessible structure8. Mental ModelThink of scraping as: 📥 Fetch → download the page🧠 Parse → understand structure🎯 Extract → get useful dataFinal TakeawayWeb scraping is not just “copying data”—it’s a structured pipeline:👉 fetch → parse → extract → transformAnd the tool you choose depends on one question:Is the data static HTML or dynamically generated?That single decision determines everything else. You can listen and download our episodes for free on more than 10 different platforms: https://linktr.ee/cybercode_academy

    Course 40 - Web Scraping with Python | Episode 16: Mastering Data Extraction with Beautiful Soup
  8. 25 Jul

    Course 40 - Web Scraping with Python | Episode 15: Mastering Items, Loaders, and Processing Pipelines

    In this lesson, you’ll learn about: how Scrapy structures scraped data using Items, how Item Loaders simplify extraction and cleaning, and how Pipelines transform raw scraped output into usable datasets1. Scrapy Items (Structured Data Containers)🔹 What Are Items?Scrapy Items are structured containers for scraped data.Think of them as:a strongly-typed dictionary for scraped content🔹 Example Structureclass StockItem(scrapy.Item): name = scrapy.Field() symbol = scrapy.Field() price = scrapy.Field() 👉 Key Insight Items force structure into messy web data2. Using Items in Scrapy Shell🔹 Manual Assignment FlowYou can: Test XPath selectorsExtract values manuallyAssign them into Items🔹 Exampleitem["name"] = response.xpath("//h1/text()").get() item["price"] = response.xpath("//fin-streamer/text()").get() 👉 Key Insight Scrapy Shell helps you validate structure before automation3. Project-Based Item Integration🔹 Moving into Real SpidersItems are defined in:items.py Then used inside spiders:yield StockItem( name=name, symbol=symbol, price=price ) 👉 Key Insight Items enforce consistency across your whole scraping system4. Exporting Data (CSV / JSON)🔹 Built-in Export Systemscrapy crawl stocks -o data.csv 🔹 Output Formats CSV → analyticsJSON → APIsXML → legacy systems👉 Key Insight Scrapy can export structured data without extra libraries5. Item Loaders (Automation Layer)🔹 Why They ExistItem Loaders reduce repetitive code and handle transformation automatically.🔹 Example Usageloader.add_xpath("price", "//span/text()") 6. Input & Output Processors🔹 MapCompose (Input Cleaning)from scrapy.loader.processors import MapCompose Used to: Clean URLsFormat stringsConvert data types🔹 TakeFirst (Output Simplification)from scrapy.loader.processors import TakeFirst Used to: Convert lists → single values👉 Key Insight Processors turn raw extraction into clean structured data automatically7. Pipelines (Post-Processing System)🔹 What Happens After ScrapingPipelines run after data extraction🔹 Example Pipelineclass PriceFilterPipeline: def process_item(self, item, spider): if float(item["price"]) > 100: item["high_value"] = True return item 👉 Key Insight Pipelines are where business logic lives8. Enabling PipelinesIn settings.py:ITEM_PIPELINES = { "myproject.pipelines.PriceFilterPipeline": 300, } Lower number = higher priority9. Full Data Flow Model Spider extracts dataItems structure itItem Loaders clean itPipelines transform itExport stores it10. Mental ModelThink of Scrapy like a factory: 🕷️ Spider → collector📦 Items → containers🧼 Loaders → cleaning station🏭 Pipelines → production lineFinal TakeawayScrapy is not just about scraping—it’s about turning raw web data into structured, validated datasets automatically.Once you master Items → Loaders → Pipelines:👉 you stop “extracting data” 👉 and start engineering data systems You can listen and download our episodes for free on more than 10 different platforms: https://linktr.ee/cybercode_academy

    Course 40 - Web Scraping with Python | Episode 15: Mastering Items, Loaders, and Processing Pipelines

About

Welcome to CyberCode Academy — your audio classroom for Programming and Cybersecurity. 🎧 Each course is divided into a series of short, focused episodes that take you from beginner to advanced level — one lesson at a time. From Python and web development to ethical hacking and digital defense, our content transforms complex concepts into simple, engaging audio learning. Study anywhere, anytime — and level up your skills with CyberCode Academy. 🚀 Learn. Code. Secure. You can listen and download our episodes for free on more than 10 different platforms: https://linktr.ee/cybercode_academy

You Might Also Like