<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Alex Tread</title>
    <description>The latest articles on DEV Community by Alex Tread (@treadalex).</description>
    <link>https://dev.to/treadalex</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F932134%2F8c0e708a-e477-48c7-8cb5-14101ae9c6f6.png</url>
      <title>DEV Community: Alex Tread</title>
      <link>https://dev.to/treadalex</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/treadalex"/>
    <language>en</language>
    <item>
      <title>Best Python Books for Zero to Hero based on Amazon Reviews</title>
      <dc:creator>Alex Tread</dc:creator>
      <pubDate>Sun, 11 Dec 2022 11:01:09 +0000</pubDate>
      <link>https://dev.to/treadalex/best-python-books-for-zero-to-hero-based-on-amazon-reviews-ajo</link>
      <guid>https://dev.to/treadalex/best-python-books-for-zero-to-hero-based-on-amazon-reviews-ajo</guid>
      <description>&lt;p&gt;Best Python Books for Zero to Hero based on Amazon Reviews:&lt;/p&gt;

&lt;p&gt;---- For beginners -----&lt;/p&gt;

&lt;p&gt;1) Python Crash Course, 2nd Edition: A Hands-On, Project-Based Introduction to Programming 2nd Edition&lt;/p&gt;

&lt;p&gt;4.7/5   7,754 ratings&lt;/p&gt;

&lt;p&gt;&lt;a href="https://amzn.to/3uCv91a" rel="noopener noreferrer"&gt;https://amzn.to/3uCv91a&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;2) Automate the Boring Stuff with Python, 2nd Edition: Practical Programming for Total Beginners&lt;/p&gt;

&lt;p&gt;4.7/5 2,667 ratings&lt;/p&gt;

&lt;p&gt;&lt;a href="https://amzn.to/3ULXzk1" rel="noopener noreferrer"&gt;https://amzn.to/3ULXzk1&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;3) Learn Python in One Day and Learn It Well (2nd Edition): Python for Beginners with Hands-on Project. The only book you need to start coding in Python ... (Learn Coding Fast with Hands-On Project)&lt;/p&gt;

&lt;p&gt;4.5/5 1,540 ratings&lt;/p&gt;

&lt;p&gt;&lt;a href="https://amzn.to/3WlK1x1" rel="noopener noreferrer"&gt;https://amzn.to/3WlK1x1&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;4) Python: For Beginners: A Crash Course Guide To Learn Python in 1 Week&lt;/p&gt;

&lt;p&gt;4.3/5 3,138 ratings&lt;/p&gt;

&lt;p&gt;&lt;a href="https://amzn.to/3iPUYID" rel="noopener noreferrer"&gt;https://amzn.to/3iPUYID&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;------ Advanced -------&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Python Tricks: A Buffet of Awesome Python Features&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;4.7/5 1,326 ratings&lt;/p&gt;

&lt;p&gt;&lt;a href="https://amzn.to/3BiEb7i" rel="noopener noreferrer"&gt;https://amzn.to/3BiEb7i&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Fluent Python: Clear, Concise, and Effective Programming&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;4.7/5 681 ratings&lt;/p&gt;

&lt;p&gt;&lt;a href="https://amzn.to/3uAx4TV" rel="noopener noreferrer"&gt;https://amzn.to/3uAx4TV&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;------- For Machine Learning ------&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Introduction to Machine Learning with Python: A Guide for Data Scientists&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;4.5/5 588 ratings&lt;/p&gt;

&lt;p&gt;&lt;a href="https://amzn.to/3W77ZLY" rel="noopener noreferrer"&gt;https://amzn.to/3W77ZLY&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow: Concepts, Tools, and Techniques to Build Intelligent Systems&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;4.8/5 3,128 ratings&lt;/p&gt;

&lt;p&gt;&lt;a href="https://amzn.to/3uV8HRj" rel="noopener noreferrer"&gt;https://amzn.to/3uV8HRj&lt;/a&gt;&lt;/p&gt;

</description>
      <category>welcome</category>
      <category>leadership</category>
      <category>cloudcomputing</category>
      <category>container</category>
    </item>
    <item>
      <title>Do you need data but don't know how to scrape yourself?</title>
      <dc:creator>Alex Tread</dc:creator>
      <pubDate>Sun, 06 Nov 2022 21:40:26 +0000</pubDate>
      <link>https://dev.to/treadalex/do-you-need-data-but-dont-know-how-to-scrape-yourself-2fp0</link>
      <guid>https://dev.to/treadalex/do-you-need-data-but-dont-know-how-to-scrape-yourself-2fp0</guid>
      <description>&lt;p&gt;You can see this website services for data scraping and web automation&lt;/p&gt;

&lt;p&gt;&lt;a href="https://scrapeitnow.com/"&gt;https://scrapeitnow.com/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>javascript</category>
      <category>datascience</category>
    </item>
    <item>
      <title>Python's secret weapon: generators</title>
      <dc:creator>Alex Tread</dc:creator>
      <pubDate>Sun, 30 Oct 2022 22:00:51 +0000</pubDate>
      <link>https://dev.to/treadalex/pythons-secret-weapon-generators-2c3o</link>
      <guid>https://dev.to/treadalex/pythons-secret-weapon-generators-2c3o</guid>
      <description>&lt;p&gt;Python generators are powerful, but an often underutilized tool.&lt;/p&gt;

&lt;p&gt;By definition, a generator is a function that returns an iterable object.&lt;/p&gt;

&lt;p&gt;In other words, it's a function that can be used to create a list, but instead of returning all the values at once, it yields them one at a time.&lt;/p&gt;

&lt;p&gt;This may not sound very exciting, but generators can be extremely helpful in a number of situations.&lt;/p&gt;

&lt;p&gt;For example, let's say you have a large list of objects that you need to process in some way.&lt;/p&gt;

&lt;p&gt;If you were to process the entire list at once, it would take up a lot of memory and could potentially slow down your program.&lt;/p&gt;

&lt;p&gt;However, if you were to use a generator, you could process the objects one at a time, which would be much more efficient.&lt;br&gt;
In addition, generators can be used to create infinite sequences.&lt;/p&gt;

&lt;p&gt;This is extremely useful in situations where you need to generate a lot of data, but don't want to store it all in memory.&lt;/p&gt;

&lt;p&gt;For instance, you could use a generator to generate a stream of random numbers.&lt;/p&gt;

&lt;p&gt;Generators are a very versatile tool that every Python programmer should be familiar with.&lt;/p&gt;

&lt;p&gt;So next time you find yourself needing to process a large amount of data or generate an infinite sequence, don't forget to reach for a generator!&lt;/p&gt;

</description>
      <category>python</category>
      <category>programming</category>
      <category>code</category>
    </item>
    <item>
      <title>How to take your career to the next level</title>
      <dc:creator>Alex Tread</dc:creator>
      <pubDate>Tue, 25 Oct 2022 21:24:13 +0000</pubDate>
      <link>https://dev.to/treadalex/how-to-take-your-career-to-the-next-level-5hnk</link>
      <guid>https://dev.to/treadalex/how-to-take-your-career-to-the-next-level-5hnk</guid>
      <description>&lt;p&gt;If you're already a programmer and want to take your career to the next level, here are some things to keep in mind.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Never stop learning&lt;br&gt;
The programming landscape is always changing, with new languages and frameworks being created all the time. It's important to keep up with the latest trends and technologies so that you can be the best programmer you can be.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Networking is key.&lt;br&gt;
Get involved in the programming community, whether it's online or offline. Attend meetups, join online forums, and make connections with other programmers. Not only will this help you stay up-to-date on what's happening in the programming world, but it will also help you land jobs and gigs.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Be prepared to hustle.&lt;br&gt;
The programming world is competitive, and the best way to stand out is to be able to show potential employers that you're a go-getter. Be proactive in your job search and don't be afraid to cold-email or reach out to potential employers on social media.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Offer value.&lt;br&gt;
When you're applying for jobs or gigs, make sure you highlight the ways in which you can add value to the company or project. What makes you unique? What can you bring to the table that other programmers can't?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Be patient.&lt;br&gt;
Don't expect to land your dream job or gig overnight. It takes time to build up your skills and experience, and it's important to be patient and to keep learning and growing as a programmer. If you're passionate about programming and are willing to put in the hard work, you can be successful in this field. Never stop learning, networking, and hustling, and you'll be well on your way to a successful career in programming.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Originally shared on:&lt;br&gt;&lt;br&gt;
&lt;a href="https://www.linkedin.com/company/pybuddy"&gt;LinkedIn&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
    </item>
    <item>
      <title>99% of Python Programmers don't know this feature</title>
      <dc:creator>Alex Tread</dc:creator>
      <pubDate>Mon, 24 Oct 2022 18:22:05 +0000</pubDate>
      <link>https://dev.to/treadalex/99-of-python-programmers-dont-know-this-feature-3nki</link>
      <guid>https://dev.to/treadalex/99-of-python-programmers-dont-know-this-feature-3nki</guid>
      <description>&lt;p&gt;Did you use or know about this feature before?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"PYTHON"&lt;/span&gt;

&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;# PYTHON
&lt;/span&gt;&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="si"&gt;:&lt;/span&gt;&lt;span class="c1"&gt;#&amp;lt;20&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;# PYTHON##############
&lt;/span&gt;&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="si"&gt;:&lt;/span&gt;&lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;# ______________PYTHON
&lt;/span&gt;&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="si"&gt;:&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;^&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;# .......PYTHON.......
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>python</category>
    </item>
    <item>
      <title>10 ways to optimize your Python code</title>
      <dc:creator>Alex Tread</dc:creator>
      <pubDate>Fri, 21 Oct 2022 21:55:53 +0000</pubDate>
      <link>https://dev.to/treadalex/10-ways-to-optimize-your-python-code-3kfh</link>
      <guid>https://dev.to/treadalex/10-ways-to-optimize-your-python-code-3kfh</guid>
      <description>&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Use PEP 8&lt;br&gt;
PEP 8 is the official style guide for Python code. It includes recommendations on how to format your code to make it more readable.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use the right data structures&lt;br&gt;
Python has a number of built-in data structures that you can use to store your data. Choosing the right data structure will help you optimize your code.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use the built-in functions&lt;br&gt;
Python has a number of built-in functions that you can use to manipulate data. Using the built-in functions will help you optimize your code.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use list comprehensions&lt;br&gt;
List comprehensions are a powerful feature of Python that allows you to create lists from other data structures. Using list comprehensions will help you optimize your code.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use generators&lt;br&gt;
Generators are a powerful feature of Python that allows you to create iterators. Using generators will help you optimize your code.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use the right libraries&lt;br&gt;
Python has a number of libraries that you can use to extend its functionality. Choosing the right library will help you optimize your code.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use profiling&lt;br&gt;
Profiling is a powerful technique that allows you to identify bottlenecks in your code. Using profiling will help you optimize your code.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use caching&lt;br&gt;
Caching is a powerful technique that allows you to store data in memory for faster access. Using caching will help you optimize your code.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use multiprocessing&lt;br&gt;
Multiprocessing is a powerful technique that allows you to use multiple processors to run your code. Using multiprocessing will help you optimize your code.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use the right tools &lt;br&gt;
Python has a number of tools that you can use to optimize your code. Choosing the right tool will help you optimize your code.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>python</category>
      <category>develope</category>
    </item>
    <item>
      <title>What the future of project management looks like?</title>
      <dc:creator>Alex Tread</dc:creator>
      <pubDate>Fri, 21 Oct 2022 18:07:24 +0000</pubDate>
      <link>https://dev.to/treadalex/what-the-future-of-project-management-looks-like-2ck7</link>
      <guid>https://dev.to/treadalex/what-the-future-of-project-management-looks-like-2ck7</guid>
      <description>&lt;p&gt;The future of project management is looking very bright.&lt;/p&gt;

&lt;p&gt;With the advent of new technologies, project management is evolving at a rapid pace.&lt;/p&gt;

&lt;p&gt;In the past, project management was often seen as a tedious and time-consuming process.&lt;/p&gt;

&lt;p&gt;However, with the help of new tools and techniques, project managers are now able to complete projects more efficiently and effectively.&lt;/p&gt;

&lt;p&gt;One of the most important trends in project management is the move towards more agile methods.&lt;/p&gt;

&lt;p&gt;Agile project management is a methodology that focuses on delivering value to the customer through short, iterative cycles.&lt;/p&gt;

&lt;p&gt;This approach is very beneficial for projects that are constantly changing and evolving.&lt;/p&gt;

&lt;p&gt;Another trend that is having a major impact on project management is the rise of cloud computing.&lt;/p&gt;

&lt;p&gt;Cloud computing allows project managers to access their project management tools and applications from anywhere in the world. This is a very convenient way to manage projects and is also very cost-effective.&lt;/p&gt;

&lt;p&gt;Big data is another area that is having a major impact on project management.&lt;/p&gt;

&lt;p&gt;With the help of big data, project managers are able to make better decisions and improve the overall efficiency of their projects.&lt;/p&gt;

&lt;p&gt;Overall, the future of project management is looking very bright. With the help of new technologies, project managers are now able to manage projects more effectively and efficiently.&lt;/p&gt;

</description>
      <category>projects</category>
      <category>management</category>
      <category>agile</category>
    </item>
    <item>
      <title>Difference between Software Developer and Software Engineer</title>
      <dc:creator>Alex Tread</dc:creator>
      <pubDate>Fri, 21 Oct 2022 17:55:41 +0000</pubDate>
      <link>https://dev.to/treadalex/difference-between-software-developer-and-software-engineer-49cn</link>
      <guid>https://dev.to/treadalex/difference-between-software-developer-and-software-engineer-49cn</guid>
      <description>&lt;p&gt;There are many differences between software engineers and software developers.&lt;/p&gt;

&lt;p&gt;The most obvious difference is that software engineers usually have a college degree, while software developers may or may not have a college degree.&lt;/p&gt;

&lt;p&gt;Software engineers typically have a more formal approach to problem-solving and are more likely to use IDEs and other tools to help them write code.&lt;/p&gt;

&lt;p&gt;On the other hand, software developers are often more comfortable working in text editors and using the command line.&lt;/p&gt;

&lt;p&gt;Software engineers are usually more focused on the big picture, and they often work with architects and other engineers to make sure that the code they write is maintainable and scalable.&lt;/p&gt;

&lt;p&gt;On the other hand, software developers are often more focused on writing code that meets the specific requirements of the project they are working on.&lt;/p&gt;

&lt;p&gt;The bottom line is that both software engineers and software developers are important members of the software development team, and both play a vital role in the success of a project.&lt;/p&gt;

</description>
      <category>python</category>
      <category>engineer</category>
      <category>develope</category>
    </item>
    <item>
      <title>Enumerate Python - Examples</title>
      <dc:creator>Alex Tread</dc:creator>
      <pubDate>Sun, 16 Oct 2022 12:14:09 +0000</pubDate>
      <link>https://dev.to/treadalex/enumerate-python-examples-5cb1</link>
      <guid>https://dev.to/treadalex/enumerate-python-examples-5cb1</guid>
      <description>&lt;p&gt;We use for loops in a lot of cases in Python, but sometimes we need to get the current index of the current iterating element&lt;br&gt;
inside the loop.&lt;/p&gt;

&lt;p&gt;If we have a list like this in python:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;languages&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;'French'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;'English'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;'German'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;'Chinese'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can get the index in different ways, for example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;index&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;span class="n"&gt;languages&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;'French'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;'English'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;'German'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;'Chinese'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;lang&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;languages&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;lang&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;index&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It will print:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="n"&gt;French&lt;/span&gt;
&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="n"&gt;English&lt;/span&gt;
&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="n"&gt;German&lt;/span&gt;
&lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="n"&gt;Chinese&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or we can use something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;languages&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;'French'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;'English'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;'German'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;'Chinese'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;index&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;languages&lt;/span&gt;&lt;span class="p"&gt;)):&lt;/span&gt;
    &lt;span class="n"&gt;lang&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;languages&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;lang&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But in Python, there is always a better way to do things right?&lt;/p&gt;

&lt;p&gt;In this case, we use something called Enumerate in Python.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;languages&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;'French'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;'English'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;'German'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;'Chinese'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;enumerate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;languages&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It will print:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="n"&gt;French&lt;/span&gt;
&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="n"&gt;English&lt;/span&gt;
&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="n"&gt;German&lt;/span&gt;
&lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="n"&gt;Chinese&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>python</category>
      <category>basics</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Find all texts of a webpage with Python</title>
      <dc:creator>Alex Tread</dc:creator>
      <pubDate>Sat, 15 Oct 2022 22:21:19 +0000</pubDate>
      <link>https://dev.to/treadalex/find-all-texts-of-a-webpage-with-python-2da3</link>
      <guid>https://dev.to/treadalex/find-all-texts-of-a-webpage-with-python-2da3</guid>
      <description>&lt;p&gt;In this article, we will make a small script to find all texts of a website with python.&lt;/p&gt;

&lt;p&gt;To implement this we will use an amazing python library called Beautiful Soup and requests.&lt;/p&gt;

&lt;p&gt;Beautiful Soup is a Python library for pulling data out of HTML and XML files. It works with your favorite parser to provide idiomatic ways of navigating, searching, and modifying the parse tree. It commonly saves programmers hours or days of work.&lt;/p&gt;

&lt;p&gt;So let's get started...&lt;/p&gt;

&lt;p&gt;First of all, we will create a virtual environment :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir &lt;/span&gt;TextExtractor &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;cd &lt;/span&gt;TextExtractor
pip3 venv .venv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then we activate this environment&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;source&lt;/span&gt; .venv/bin/activate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We install Beautiful Soup library&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;&lt;span class="nv"&gt;beautifulsoup4&lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;4.11.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We install requests library&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;requests
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then we create a file called &lt;strong&gt;main.py&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In this file, we first import the BeautifulSoup Library and requests libraries&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;requests&lt;/span&gt; 
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;bs4&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;BeautifulSoup&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We will take an example of a website for example &lt;strong&gt;Medium.com&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We first will create a function to get content of a website with &lt;strong&gt;requests&lt;/strong&gt; library&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;get_page_content&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;page_url&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
     &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;page_url&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
     &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;status_code&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
          &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;
     &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can get the content like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;content&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;get_page_content&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'https://medium.com/'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To parse the text we need to create the soup object like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;soup&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;BeautifulSoup&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;html&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We find all the elements that has text in this way:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;tags_with_text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;soup&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;find_all&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then we can get the text list:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;texts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;tag&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;tag&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;tags_with_text&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will return a list of texts like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;''&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;'Medium – Where good ... find you.'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;'{"@context":"http:&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s"&gt;u...ght":168}}'&lt;/span&gt;&lt;span class="p"&gt;,...]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here we see that we have a lot of script texts and texts that we don't want.&lt;/p&gt;

&lt;p&gt;We need to ignore some tags,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;TAGS_TO_IGNORE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;'script'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s"&gt;'style'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;'meta'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and we get all texts with this one liner&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;texts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;tag&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;strip&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;tag&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;tags_with_text&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tag&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;tag&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;TAGS_TO_IGNORE&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can create a function to get all the texts from a page, it will be like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;get_texts_from_page&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;page_url&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;content&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;get_page_content&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;page_url&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;soup&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;BeautifulSoup&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"html.parser"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;tags_with_text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;soup&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;findAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;TAGS_TO_IGNORE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;'script'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s"&gt;'style'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;'meta'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;texts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;tag&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;strip&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;tag&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;tags_with_text&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tag&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;tag&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;TAGS_TO_IGNORE&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;texts&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And the complete file &lt;strong&gt;&lt;em&gt;main.py&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;requests&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;bs4&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;BeautifulSoup&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;get_page_content&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;page_url&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;page_url&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;status_code&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
       &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;get_texts_from_page&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;page_url&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;content&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;get_page_content&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;page_url&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;soup&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;BeautifulSoup&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"html.parser"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;tags_with_text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;soup&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;findAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;TAGS_TO_IGNORE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;'script'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s"&gt;'style'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;'meta'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;texts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;tag&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;strip&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;tag&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;tags_with_text&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tag&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;tag&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;TAGS_TO_IGNORE&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;texts&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

&lt;span class="c1"&gt;# USAGE
&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;get_texts_from_page&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'https://medium.com/'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;ENJOY!&lt;/p&gt;

&lt;p&gt;Reference:&lt;br&gt;
&lt;a href="https://pybuddy.com/blog/find-all-texts-of-a-webpage-with-python/"&gt;pybuddy.com&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>datascience</category>
    </item>
    <item>
      <title>Top 5 Most Rated Github Python Libraries in 2022</title>
      <dc:creator>Alex Tread</dc:creator>
      <pubDate>Thu, 29 Sep 2022 18:08:25 +0000</pubDate>
      <link>https://dev.to/treadalex/top-5-most-rated-github-python-libraries-in-2022-167k</link>
      <guid>https://dev.to/treadalex/top-5-most-rated-github-python-libraries-in-2022-167k</guid>
      <description>&lt;p&gt;1) &lt;a href="https://pybuddy.com/repo/tensorflowtensorflow/"&gt;TensorFlow&lt;/a&gt; - An Open Source Machine Learning Framework for Everyone ( 167.77k stars )&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cZ4758jG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/455in4wm61knbxfznecb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cZ4758jG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/455in4wm61knbxfznecb.png" alt="Tensorflow" width="880" height="295"&gt;&lt;/a&gt;&lt;br&gt;
TensorFlow is an end-to-end open-source platform for machine learning. It has a comprehensive, flexible ecosystem of tools, libraries, and community resources that lets researchers push the state-of-the-art in ML, and developers easily build and deploy ML-powered applications.&lt;/p&gt;

&lt;p&gt;TensorFlow was originally developed by researchers and engineers working on the Google Brain team within Google's Machine Intelligence Research organization to conduct machine learning and deep neural networks research. The system is general enough to be applicable in a wide variety of other domains.&lt;/p&gt;

&lt;p&gt;2) &lt;a href="https://pybuddy.com/repo/huggingfacetransformers/"&gt;Transformers&lt;/a&gt; - State-of-the-art Machine Learning for Pytorch, TensorFlow, and JAX ( 70.33k stars )&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Or5hj_us--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ytrig8avpzmbunhacboz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Or5hj_us--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ytrig8avpzmbunhacboz.png" alt="Transformers hugging face " width="531" height="91"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Transformers provide thousands of pre-trained models to perform tasks on different modalities such as text, vision, and audio.&lt;/p&gt;

&lt;p&gt;These models can be applied on:&lt;/p&gt;

&lt;p&gt;📝 Text, for tasks like text classification, information extraction, question answering, summarization, translation, text generation, in over 100 languages.&lt;br&gt;
🖼️ Images, for tasks like image classification, object detection, and segmentation.&lt;br&gt;
🗣️ Audio, for tasks like speech recognition and audio classification.&lt;br&gt;
Transformer models can also perform tasks on several modalities combined, such as table question answering, optical character recognition, information extraction from scanned documents, video classification, and visual question answering.&lt;/p&gt;

&lt;p&gt;🤗 Transformers provides APIs to quickly download and use those pre-trained models on a given text, fine-tune them on your datasets, and then share them with the community on our model hub. At the same time, each python module defining an architecture is fully standalone and can be modified to enable quick research experiments.&lt;/p&gt;

&lt;p&gt;3) &lt;a href="https://pybuddy.com/repo/djangodjango/"&gt;Django&lt;/a&gt; - The Web framework for perfectionists with deadlines ( 66.5k stars )&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7nV5etUE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5zvehkoppyzdyhi80pxf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7nV5etUE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5zvehkoppyzdyhi80pxf.png" alt="Python django" width="880" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With Django, you can take web applications from concept to launch in a matter of hours. Django takes care of the hassle of web development, so you can focus on writing your app without reinventing the wheel. It’s free and open source.&lt;/p&gt;

&lt;p&gt;4) &lt;a href="https://pybuddy.com/repo/palletsflask/"&gt;Flask&lt;/a&gt; - The Python micro framework for building web applications ( 60.65k stars)&lt;br&gt;
flask python 2022&lt;/p&gt;

&lt;p&gt;Flask is a lightweight WSGI web application framework. It is designed to make getting started quick and easy, with the ability to scale up to complex applications. It began as a simple wrapper around Werkzeug and Jinja and has become one of the most popular Python web application frameworks.  Flask offers suggestions but doesn't enforce any dependencies or project layouts. It is up to the developer to choose the tools and libraries they want to use. There are many extensions provided by the community that makes adding new functionality easy.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ZidLTsQ7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/23iumnghxkerzjxyr6qd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZidLTsQ7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/23iumnghxkerzjxyr6qd.png" alt="Flask python framework" width="880" height="550"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;5) &lt;a href="https://pybuddy.com/repo/scikit-learnscikit-learn/"&gt;Scikit-Learn&lt;/a&gt; - machine learning in Python ( 51.38k stars)&lt;/p&gt;

&lt;p&gt;Scikit-learn is a Python module for machine learning built on top of SciPy and is distributed under the 3-Clause BSD license. The project was started in 2007 by David Cournapeau as a Google Summer of Code project, and since then many volunteers have contributed. It is currently maintained by a team of volunteers.&lt;/p&gt;

&lt;p&gt;Which is the best python library you used this year?&lt;/p&gt;

</description>
      <category>python</category>
      <category>github</category>
      <category>django</category>
      <category>flask</category>
    </item>
    <item>
      <title>✨ Most rated crypto related GitHub libraries</title>
      <dc:creator>Alex Tread</dc:creator>
      <pubDate>Wed, 28 Sep 2022 22:16:15 +0000</pubDate>
      <link>https://dev.to/treadalex/most-rated-crypto-related-github-libraries-5f9g</link>
      <guid>https://dev.to/treadalex/most-rated-crypto-related-github-libraries-5f9g</guid>
      <description>&lt;p&gt;There are a lot of GitHub open source crypto libraries&lt;br&gt;
Here is a list of most rated crypto-related libraries:&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://github.com/bitcoin/bitcoin"&gt;Bitcoin Core integration/staging tree - 66.3k stars&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YYRSaG_p--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4hrqmizqo309m1tra5f9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YYRSaG_p--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4hrqmizqo309m1tra5f9.png" alt="Bitcoin generated image" width="880" height="440"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Bitcoin Core connects to the Bitcoin peer-to-peer network to download and fully validate blocks and transactions. It also includes a wallet and graphical user interface, which can be optionally built.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://github.com/ethereum/go-ethereum"&gt;Go Etherum - 39.5k stars&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yJ8nchEQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u9pu1hzu9mr214h1yxn0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yJ8nchEQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u9pu1hzu9mr214h1yxn0.png" alt="Etherum generated library" width="880" height="440"&gt;&lt;/a&gt;&lt;br&gt;
Official Go implementation of the Ethereum protocol&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://github.com/ccxt/ccxt"&gt;CCXT – CryptoCurrency eXchange Trading Library - 25.8k stars&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ds6W_duC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jnqrs2lf1n67f8d4qp1p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ds6W_duC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jnqrs2lf1n67f8d4qp1p.png" alt="Javascript php python library for trading" width="880" height="440"&gt;&lt;/a&gt;&lt;br&gt;
A JavaScript / Python / PHP library for cryptocurrency trading and e-commerce with support for many bitcoin/ether/altcoin exchange markets and merchant APIs.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://github.com/bitcoinbook/bitcoinbook"&gt;Mastering Bitcoin 2nd Edition - Programming the Open Blockchain - 20.4k stars&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--O2-U_2am--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/08lb68c27x4fmj1i9r5g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--O2-U_2am--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/08lb68c27x4fmj1i9r5g.png" alt="Mastering bitcoin" width="880" height="440"&gt;&lt;/a&gt;&lt;br&gt;
Mastering Bitcoin is a book for developers, although the first two chapters cover bitcoin at a level that is also approachable to non-programmers. Anyone with a basic understanding of technology can read the first two chapters to get a great understanding of bitcoin.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://github.com/freqtrade/freqtrade"&gt;Freqtrade - 19.3k stars&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Z10bx0oZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://bestcryptolibs.com/media/freqtrade.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Z10bx0oZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://bestcryptolibs.com/media/freqtrade.png" alt="Freqtrade" width="880" height="440"&gt;&lt;/a&gt;&lt;br&gt;
Freqtrade is a free and open source crypto trading bot written in Python. It is designed to support all major exchanges and be controlled via Telegram or webUI. It contains backtesting, plotting and money management tools as well as strategy optimization by machine learning.&lt;/p&gt;

&lt;p&gt;Source:&lt;br&gt;
&lt;a href="https://bestcryptolibs.com/"&gt;Best Crypto Libraries&lt;/a&gt;&lt;/p&gt;

</description>
      <category>crypto</category>
      <category>javascript</category>
      <category>python</category>
      <category>github</category>
    </item>
  </channel>
</rss>
