<?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: Eva</title>
    <description>The latest articles on DEV Community by Eva (@eva_dev).</description>
    <link>https://dev.to/eva_dev</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%2F1204308%2F335bc2ef-6c30-4227-8ae4-3f76f30a824a.jpg</url>
      <title>DEV Community: Eva</title>
      <link>https://dev.to/eva_dev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/eva_dev"/>
    <language>en</language>
    <item>
      <title>Merge the Current Branch to Main and Push to GitHub</title>
      <dc:creator>Eva</dc:creator>
      <pubDate>Sat, 21 Feb 2026 16:04:38 +0000</pubDate>
      <link>https://dev.to/eva_dev/merge-the-current-branch-to-main-and-push-to-github-49co</link>
      <guid>https://dev.to/eva_dev/merge-the-current-branch-to-main-and-push-to-github-49co</guid>
      <description>&lt;h2&gt;
  
  
  | objective |
&lt;/h2&gt;

&lt;p&gt;Merging the current branch to main at the end of a successful dev session is a professional "best practice." It ensures your "production" code is up to date and earns you that well-deserved, sweet, green square on your GitHub contribution graph.&lt;/p&gt;

&lt;h2&gt;
  
  
  | how-to |
&lt;/h2&gt;

&lt;p&gt;1) Commit your current work to your branch:&lt;br&gt;
&lt;code&gt;git add .&lt;/code&gt;&lt;br&gt;
&lt;code&gt;git commit -m "feat: &amp;lt;details&amp;gt;"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Optional: You can push the branch for now and merge it to main later.&lt;br&gt;
&lt;code&gt;git push origin &amp;lt;branch name&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;2) Switch to the main branch:&lt;br&gt;
&lt;code&gt;git checkout main&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Optional: Pull the latest changes from the remote &lt;code&gt;main&lt;/code&gt; branch to keep your local &lt;code&gt;main&lt;/code&gt; up to date and avoid conflicts.&lt;br&gt;
&lt;code&gt;git pull origin main&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;3) Merge your feature branch into main:&lt;br&gt;
&lt;code&gt;git merge &amp;lt;branch name&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;4) Resolve any merge conflicts if Git reports any:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;If conflicts occur, Git will indicate which files are in conflict.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Manually edit the files to resolve the conflicts (the files will contain markers like &lt;code&gt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&lt;/code&gt;, &lt;code&gt;=======&lt;/code&gt;, and &lt;code&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After resolving, stage the files:&lt;br&gt;
&lt;code&gt;git add &amp;lt;resolved-file&amp;gt;&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Complete the merge with a commit:&lt;br&gt;
&lt;code&gt;git commit&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;5) Push the main branch to GitHub:&lt;br&gt;
&lt;code&gt;git push origin main&lt;/code&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>git</category>
      <category>github</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Scraping webpage header text with Python</title>
      <dc:creator>Eva</dc:creator>
      <pubDate>Tue, 15 Oct 2024 01:18:18 +0000</pubDate>
      <link>https://dev.to/eva_dev/scraping-webpage-header-text-with-python-oko</link>
      <guid>https://dev.to/eva_dev/scraping-webpage-header-text-with-python-oko</guid>
      <description>&lt;h2&gt;
  
  
  | task |
&lt;/h2&gt;

&lt;p&gt;We have several lists of URLs and need to get the headers from these pages. Assuming all the headers are wrapped in h1 tags and these pages are done in HTML/CSS.&lt;/p&gt;

&lt;h2&gt;
  
  
  | tech |
&lt;/h2&gt;

&lt;p&gt;Python* and Beautifulsoup&lt;br&gt;
*you need to install Python and bs4, and create a virtual environment to run Python. [how-to tk]&lt;/p&gt;
&lt;h2&gt;
  
  
  | solution |
&lt;/h2&gt;

&lt;p&gt;First, put the URL lists into its .txt file and save them under the same folder as the project. After that, create another .txt file to store your output (output.txt).&lt;/p&gt;

&lt;p&gt;Create a Python file (.py) to write the script in. &lt;/p&gt;

&lt;p&gt;Here is the logic:&lt;/p&gt;



&lt;p&gt;1) go to the URL, and get the HTML content of the page&lt;br&gt;
2) if we can get the HTML content and the h1 tag exist&lt;br&gt;
3) we get the text inside of the h1 tag and put it into our output.txt file&lt;br&gt;
4) repeat the above steps for all the URLs&lt;br&gt;
5) repeat the above for all the URL list .txt files in the folder if you have separate URL lists.&lt;/p&gt;



&lt;p&gt;Full script:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import requests
from bs4 import BeautifulSoup

def print_h1(url: str):
    response = requests.get(url) # querying the webpage, and get an object as a response 
    soup = BeautifulSoup(response.text, 'html.parser')
    if response.status_code != 200 or soup.h1 == None:
        print("FAILED: ", url)
        return
    print("\t", soup.h1.text)

files = ["urls/urllist1.txt", "urls/urllist2.txt"]

for file in files:
    with open(file) as f:
        urls = f.readlines()
        print(file)
        for url in urls:
            print_h1(url.strip())
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here is the breakdown:&lt;br&gt;
1) First, we need to import dependencies.&lt;br&gt;
&lt;code&gt;import requests&lt;br&gt;
from bs4 import BeautifulSoup&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;2) Write an algorithm to loop through the URL list files, and loop through all the URLs in one list. &lt;br&gt;
Use a custom function "print_h1" to extract the h1 from the page, and url.strip() removes any extra space around the URLs in the .txt file. We also added "print(file)" so we know which URL list file all the headers belong to. &lt;br&gt;
&lt;code&gt;for file in files:&lt;br&gt;
    with open(file) as f:&lt;br&gt;
        urls = f.readlines()&lt;br&gt;
        print(file)&lt;br&gt;
        for url in urls:&lt;br&gt;
            print_h1(url.strip())&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;3) Create an array for all the URL list files.&lt;br&gt;
&lt;code&gt;files = ["urls/urllist1.txt", "urls/urllist2.txt"]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;At the end of #2, we have a function "print_h1" that needs to be defined. Now let's create the function. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;response = requests.get(url)&lt;/code&gt;&lt;br&gt;
Get the URL from the .txt file&lt;/p&gt;

&lt;p&gt;&lt;code&gt;soup = BeautifulSoup(response.text, 'html.parser')&lt;/code&gt;&lt;br&gt;
This line creates a Python Beautiful Soup object and passes it to Python’s built-in HTML parser.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;if response.status_code != 200 or soup.h1 == None:&lt;br&gt;
        print("FAILED: ", url)&lt;br&gt;
        return&lt;/code&gt;&lt;br&gt;
This is our error-catching block. If we can't get an URL as a response, or there is no h1 tag on the page, we print "FAILED" and append the URL.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;print("\t", soup.h1.text)&lt;/code&gt;&lt;br&gt;
We print the text in the h1 tag in output.txt. "\t" adds a tab in front of the text.&lt;br&gt;
[tk: how do we make the function print the output in output.txt?]&lt;/p&gt;

&lt;p&gt;Run the Python file and it should write all the headers and error messages into the output file.&lt;/p&gt;

&lt;p&gt;credit:&lt;br&gt;
&lt;a href="https://github.com/christianrang" rel="noopener noreferrer"&gt;Christian Rang&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;reference:&lt;br&gt;
&lt;a href="https://oxylabs.io/blog/beautiful-soup-parsing-tutorial" rel="noopener noreferrer"&gt;https://oxylabs.io/blog/beautiful-soup-parsing-tutorial&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.crummy.com/software/BeautifulSoup/bs4/doc/" rel="noopener noreferrer"&gt;https://www.crummy.com/software/BeautifulSoup/bs4/doc/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Photo by &lt;a href="https://unsplash.com/@quesada179?utm_content=creditCopyText&amp;amp;utm_medium=referral&amp;amp;utm_source=unsplash" rel="noopener noreferrer"&gt;Javier Quesada&lt;/a&gt; on &lt;a href="https://unsplash.com/photos/person-in-front-of-imac-ZYb_fGvNndA?utm_content=creditCopyText&amp;amp;utm_medium=referral&amp;amp;utm_source=unsplash" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>'Switch' is not exported from 'react-router-dom'</title>
      <dc:creator>Eva</dc:creator>
      <pubDate>Wed, 06 Mar 2024 04:11:34 +0000</pubDate>
      <link>https://dev.to/eva_dev/switch-is-not-exported-from-react-router-dom-27eh</link>
      <guid>https://dev.to/eva_dev/switch-is-not-exported-from-react-router-dom-27eh</guid>
      <description>&lt;h2&gt;
  
  
  | error message |
&lt;/h2&gt;

&lt;p&gt;SyntaxError: The requested module '/node_modules/.vite/deps/react-router-dom.js?v=0634216f' does not provide an export named 'Switch'&lt;/p&gt;

&lt;h2&gt;
  
  
  | tech |
&lt;/h2&gt;

&lt;p&gt;Vite as the local server with TypeScript&lt;/p&gt;

&lt;h2&gt;
  
  
  | solution |
&lt;/h2&gt;

&lt;p&gt;In react-router-dom v6, "Switch" is replaced by routes "Routes". Here are the related updates you should make to your code:&lt;br&gt;
update:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { BrowserRouter as Router, Route, Routes } from 'react-router-dom';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;update:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;Route path="/" component={Home} /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;Route path='/' element={&amp;lt;Home/&amp;gt;} /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Other steps you may take to resolve this issue:&lt;/p&gt;

&lt;p&gt;1) Check react-router-dom Version: Make sure that you're using the up-to-date version for 'react-router-dom'&lt;/p&gt;

&lt;p&gt;2) Verify Import Statement: Double-check your import statement for the "Routes" component. &lt;/p&gt;

&lt;p&gt;3) Check node_modules Directory: Verify that react-router-dom is installed in your node_modules directory. You can navigate to your project directory and check if there's a react-router-dom folder inside the node_modules folder.&lt;/p&gt;

&lt;p&gt;4) Check package.json: Open your package.json file and ensure that react-router-dom is listed as a dependency. It should look something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"dependencies": {
    "react-router-dom": "^X.X.X",
    ...
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Happy coding!&lt;br&gt;
Eva&lt;/p&gt;

&lt;p&gt;Reference: &lt;a href="https://stackoverflow.com/questions/63124161/attempted-import-error-switch-is-not-exported-from-react-router-dom"&gt;https://stackoverflow.com/questions/63124161/attempted-import-error-switch-is-not-exported-from-react-router-dom&lt;/a&gt;&lt;br&gt;
More recouce:&lt;br&gt;
&lt;a href="https://reactrouter.com/en/main/upgrading/v5"&gt;https://reactrouter.com/en/main/upgrading/v5&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Reverting to a Previous Commit with Git</title>
      <dc:creator>Eva</dc:creator>
      <pubDate>Sat, 03 Feb 2024 18:42:08 +0000</pubDate>
      <link>https://dev.to/eva_dev/reverting-to-a-previous-commit-with-git-2ph</link>
      <guid>https://dev.to/eva_dev/reverting-to-a-previous-commit-with-git-2ph</guid>
      <description>&lt;h2&gt;
  
  
  | tech |
&lt;/h2&gt;

&lt;p&gt;Working with Git and GitHub using Visual Studio Code&lt;/p&gt;

&lt;h2&gt;
  
  
  | goal |
&lt;/h2&gt;

&lt;p&gt;Reverting to a previous commit that was already pushed to GitHub and potentially getting rid of any updates I made since the commit &lt;/p&gt;

&lt;h2&gt;
  
  
  | solution |
&lt;/h2&gt;

&lt;p&gt;In your terminal on VSCode, enter &lt;code&gt;git log&lt;/code&gt; to see your previous commits:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp4d36tpmubp6h2cz8s3t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp4d36tpmubp6h2cz8s3t.png" alt="Image description" width="800" height="885"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Locate the commit that you'd like to revert to and copy its ID:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwo56kjn28qdi49cp0hmx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwo56kjn28qdi49cp0hmx.png" alt="Image description" width="800" height="315"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then enter &lt;code&gt;git stash&lt;/code&gt; to stash away any changes you've done since the last commit, and enter &lt;code&gt;git rest --hard 7a217627b999b54b6e60d8a2c7f61e7054da8f7b&lt;/code&gt; (the long string is the commit ID).&lt;/p&gt;

&lt;p&gt;Your files should revert to whichever commit you choose after these steps. If you wish to retrieve the work that you stashed away, use the command &lt;code&gt;git stash pop&lt;/code&gt; and they'll show up, but in my case, I don't need the work anymore. I've seen articles suggesting using the command &lt;code&gt;git rest --hard 7a217627b999b54b6e60d8a2c7f61e7054da8f7b&lt;/code&gt; right away without stashing your work, but that is a less preferred approach to me.&lt;/p&gt;

&lt;p&gt;Happy coding!&lt;/p&gt;

&lt;p&gt;source: &lt;a href="https://stackoverflow.com/questions/4114095/how-do-i-revert-a-git-repository-to-a-previous-commit"&gt;stackoverflow&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Troubleshooting Vite Deployment Issues on Netlify</title>
      <dc:creator>Eva</dc:creator>
      <pubDate>Wed, 08 Nov 2023 22:13:26 +0000</pubDate>
      <link>https://dev.to/eva_dev/troubleshooting-vite-deployment-issues-on-netlify-2ohf</link>
      <guid>https://dev.to/eva_dev/troubleshooting-vite-deployment-issues-on-netlify-2ohf</guid>
      <description>&lt;h2&gt;
  
  
  | tech |
&lt;/h2&gt;

&lt;p&gt;Code stored on GitHub and then deployed on Netlify&lt;/p&gt;

&lt;h2&gt;
  
  
  | error message |
&lt;/h2&gt;

&lt;p&gt;Failed during stage "Reading and parsing configuration files"  &lt;/p&gt;

&lt;h2&gt;
  
  
  | solution |
&lt;/h2&gt;

&lt;p&gt;In "Build settings" enter the below configuration:&lt;br&gt;
Base directory:&lt;br&gt;
Package directory:&lt;br&gt;
Build command: vite build&lt;br&gt;
Publish directory: dist&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BSg_0ptY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fjos4pgvy99injepmqyb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BSg_0ptY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fjos4pgvy99injepmqyb.png" alt="Build settings" width="800" height="844"&gt;&lt;/a&gt;&lt;br&gt;
Leave the rest as is and deploy.&lt;/p&gt;

&lt;h2&gt;
  
  
  | context |
&lt;/h2&gt;

&lt;p&gt;One of the things that has become a prerequisite of whether or not I would continue developing an app is my ability to deploy it online. As a not-so-new-newbie to software development, I've run into several issues deploying my apps in the past, resulting in me not being able to share my work with the world. As much as I love coding, if no one can see and interact with my work, it diminishes the purpose of creating apps!&lt;/p&gt;

&lt;p&gt;Yes, I love to be dramatic, but wouldn't you agree that it's just as satisfying to share your apps with people? That's why after setting up the basic structure for this app, I tested the deployment right away but had no success.&lt;/p&gt;

&lt;p&gt;I tried several different configurations for the deployment but failed, and when I was eventually able to deploy the web app, it loaded as a blank site. I knew it had something to do with Vite and the configurations on Netlify, and after a lot of trial and error, I found the correct config.&lt;/p&gt;

&lt;p&gt;Other than reading the error messages on your platform of choice for deployment, try these steps the next time you encounter deployment issues:&lt;br&gt;
1) Open the web inspector on the browser you are using to view the website or web app. Here I used Chrome, my preferred browser, but I also recommend Firefox.&lt;br&gt;
2) Go to the console tab, or just click on the error icons that show up on your web inspector, if any, and it will open the console tab.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dHx0UNpG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pz7o6f6z7t6fa8u6ww5x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dHx0UNpG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pz7o6f6z7t6fa8u6ww5x.png" alt="Chrome web inspector" width="800" height="212"&gt;&lt;/a&gt;&lt;br&gt;
3) Google the error message and read the first few search results that come up.&lt;/p&gt;

&lt;p&gt;Here is a log of all the failed deployments. To me, all the failed attempts are just part of a journey to the eventual shiny green "Published" status:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zEKyoFJY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lofwtn2d12u3awyvbk6n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zEKyoFJY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lofwtn2d12u3awyvbk6n.png" alt="failed deployments" width="800" height="618"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Have you encountered similar deployment challenges in your projects? Share your experiences!&lt;/p&gt;

&lt;p&gt;Xoxo,&lt;br&gt;
Eva&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
