OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Trying to find if an element is in a web page title

  • Thread starter Thread starter user25653727
  • Start date Start date
U

user25653727

Guest
Im building a tool to check a list of Instagram username and tell if they are available. So for first underestand web scraping, i tried to check if "(" is in the title of the instagram page of @paris

Code:
import requests
from bs4 import BeautifulSoup
url = requests.get('https://www.instagram.com/paris/')
soup = BeautifulSoup ( url.content , "html.parser" )
title = soup.find('title')
print(title)
if '(' in title:
    print("Y")

So the page actually contain a ( inside is title but when i try the condition "if '(' in title" i doesn't print Y so it doesn't find the ( in "title"

Can anyone give me a way to make this code actually work, it's gonna be important for my project (sorry for my bad english, im french)
<p>Im building a tool to check a list of Instagram username and tell if they are available. So for first underestand web scraping, i tried to check if "(" is in the title of the instagram page of @paris</p>
<pre><code>import requests
from bs4 import BeautifulSoup
url = requests.get('https://www.instagram.com/paris/')
soup = BeautifulSoup ( url.content , "html.parser" )
title = soup.find('title')
print(title)
if '(' in title:
print("Y")
</code></pre>
<p>So the page actually contain a ( inside is title but when i try the condition "if '(' in title" i doesn't print Y so it doesn't find the ( in "title"</p>
<p>Can anyone give me a way to make this code actually work, it's gonna be important for my project
(sorry for my bad english, im french)</p>
 

Latest posts

Online statistics

Members online
1
Guests online
5
Total visitors
6
Top