title: Is there any way to extract data from CSS generated content using BeautifulSoup?
body: <p>I was trying to scrape some data from justdail.com and while doing so I realized that the phone numbers listed on the site are not as texts in the HTML document instead they are saved as content in a css class like:</p>
  <p><code> .icon-wyx:before {content: &quot;\9d010&quot;;}</code></p>
  <p>Here the '0' at the end is a digit of the phone number is there any way for me to extract these digits from the css content using BeautifulSoup?</p>
  <p>The html linked to the css is</p>
  <pre class="lang-html prettyprint-override"><code>&lt;span class=&quot;mobilesv icon-poh&quot;&gt;
     ::before
  &lt;/span&gt;
  
  </code></pre>
  <p>Attaching the screenshot here:</p>
  <p><a href="https://i.stack.imgur.com/Hcakh.png" rel="nofollow noreferrer">inspect img1</a></p>
  <p><a href="https://i.stack.imgur.com/icFDx.png" rel="nofollow noreferrer">inspect img2</a></p>
  <p>My code:</p>
  <pre class="lang-py prettyprint-override"><code>from bs4 import BeautifulSoup
  import requests
  
  url= &quot;https://www.justdial.com/Balasore/Readymade-Garment-Retailers/nct-10401947/page-1&quot;
  
  r = requests.get(url=url,headers={'User-Agent' : &quot;Mozilla/5.0 (Windows NT 6.1; Win64; x64)&quot;})
  print(r.status_code)
  soup = BeautifulSoup(r.content, &quot;html.parser&quot;)
  orgs = soup.find_all('div',{'class':'col-sm-5 col-xs-8 store-details sp-detail paddingR0'})
  
  org_name = orgs[0].find('span', {'class':'lng_cont_name'}).attrs['data-cn']
  print(org_name)
  
  org_phone = orgs[0].find_all('span',{'class':'mobilesv'})
  print(org_phone[0])
  </code></pre>
  <p>The output:</p>
  <pre><code>200
  City Life
  &lt;span class=&quot;mobilesv icon-tsj&quot;&gt;&lt;/span&gt;
  </code></pre>
  <p>Here as we can see the css of the class icon-tsj is no where to be found in the parshed html but the value of it's content attribute is required to scrape the phone number. Any ideas how to do it?</p>