Home Whiteboard Practice Code Graphing Calculator Online Compilers Articles Tools

Explore Categories

Find the perfect tutorial for your learning journey

Python TechnologiesDatabasesComputer ProgrammingWeb DevelopmentJava TechnologiesComputer ScienceMobile DevelopmentBig Data & AnalyticsMicrosoft TechnologiesDevOpsLatest TechnologiesMachine LearningDigital MarketingSoftware QualityManagement Tutorials View All Categories
Tutorials Courses Jobs Login
Technical Questions and Answers

Article Categories

  • All Categories
  • Data Structure Data Structure
  • Networking Networking
  • RDBMS RDBMS
  • Operating System Operating System
  • Java Java
  • MS Excel MS Excel
  • iOS iOS
  • HTML HTML
  • CSS CSS
  • Android Android
  • Python Python
  • C Programming C Programming
  • C++ C++
  • C# C#
  • MongoDB MongoDB
  • MySQL MySQL
  • Javascript Javascript
  • PHP PHP
  • Economics & Finance Economics & Finance
Selected Reading
  • UPSC IAS Exams Notes
  • Developer's Best Practices
  • Questions and Answers
  • Online Resume Builder
  • HR Interview Questions
  • Computer Glossary
  • Who is Who

How to write Python regular expression to get all the anchor tags in a webpage?

Python Server Side Programming Programming

The following code extracts all tags in the given string

Example

import re
rex = re.compile(r'[\]')
l = "this is text1 hi this is text2"
print rex.findall(l)

Output

['', '']
Rajendra Dharmkar
Rajendra Dharmkar

Updated on: 2020-02-20T07:56:17+05:30

251 Views

Learn More in Our Tutorials

  • Beautiful Soup - Scraping Paragraphs from HTML Beautiful Soup
  • Python Text Processing - Extract URL from Text Python Text Processing
  • Python Web Scraping - Introduction Python Web Scraping
  • Beautiful Soup - Getting All HTML Tags Beautiful Soup
Kickstart Your Career

Get certified by completing the course

Get Started
Previous Next
Advertisements
  • ABOUT US
  • OUR TEAM
  • CAREERS
  • JOBS
  • CONTACT US
  • TERMS OF USE
  • PRIVACY POLICY
  • REFUND POLICY
  • COOKIES POLICY
  • FAQ'S
tutorials point logo
Download Android App Download IOS App

Tutorials Point is a leading Ed Tech company striving to provide the best learning material on technical and non-technical subjects.

Copyright 2026. All Rights Reserved.