You can see 75M followers. But I need exact value of the followers. Here is a tooltip that shows us the exact value. And also when I have looked at the ui element in browser, title attribute has the exact value of followers.
As Im trying to explain before, I need exact value of the followers count. When you hover over 40M value. you can see exact value of the followers. for example 40.324.123
To get the exact number of Instagram followers for an account like “FC Barcelona” (@fcbarcelona), you can use JavaScript to extract the value from the title attribute in the browser’s developer tools. Here’s a step-by-step guide:
Step-by-Step Solution
Open the Instagram Profile in Your Browser: Navigate to the Instagram profile page of the user whose followers count you want to retrieve. For example: FC Barcelona Instagram.
Open Developer Tools: Right-click on the page and select “Inspect” (or press Ctrl+Shift+I on Windows/Linux or Cmd+Option+I on macOS) to open the browser’s Developer Tools.
Locate the Followers Count Element: In the Elements tab of the Developer Tools, use the element selector tool (a mouse icon) to hover over the followers count on the page. This will highlight the HTML element corresponding to the followers count.
Check the Title Attribute: When you find the element, you will notice a title attribute that contains the exact number of followers. It usually looks like this:
html
Copy code
<span title="75,123,456">75M</span>
Extract the Value Using JavaScript: To get this value, you can run the following JavaScript code in the Console tab of the Developer Tools:
javascript
Copy code
const followersElement = document.querySelector('a[href$="/followers/"] span'); // Select the followers span element
const exactFollowersCount = followersElement.getAttribute('title'); // Get the title attribute
console.log(exactFollowersCount); // Print the exact followers count
Explanation
Selector:a[href$="/followers/"] span targets the span element inside the anchor tag that links to the followers list. The $ symbol in the selector ensures that it matches the end of the href attribute.
Get Attribute:getAttribute('title') retrieves the exact value of the followers count stored in the title attribute.
Example Output
Running the script should print the exact followers count to the console, like:
Copy code
75,123,456
Notes
This method requires you to manually inspect the page and run the script each time you want to get the exact count.
Instagram’s layout and class names may change over time, so the selector might need to be updated accordingly.
This approach should help you retrieve the exact number of Instagram followers directly from the page.