Question: I have a folder named "Models" located at app/models in my laravel project directory. 
I want to use all models by a single line of code in controller, instead of using each one like:

```
use App/Models/User;
use App/Models/Roles;

```

Answer: 
If i get the question correctly, you need to get the initial text from a tag just before the child tag. A tag’s children are available in a list called [.contents](https://www.crummy.com/software/BeautifulSoup/bs4/doc/#contents-and-children) .

You can use `.contents[0]`

```
from bs4 import BeautifulSoup
html="""
<span class="t-small summary-count">  Showing 1-25 of 131 ads for <span>"Samsung Galaxy A5"</span>.</span>
"""
soup=BeautifulSoup(html,'html.parser')
pgn = soup.find("span", {"class": "t-small summary-count"})
print(pgn.contents)
print(pgn.contents[0])

```

Output

```
['  Showing 1-25 of 131 ads for ', <span>"Samsung Galaxy A5"</span>, '.']
  Showing 1-25 of 131 ads for 

```
You need to find `<span> .... </span>` with `select` and then get text before it with using `previousSibling`
All code : 

```
from bs4 import BeautifulSoup
html = ''' <span class="t-small summary-count">  Showing 1-25 of 131 ads for 
<span>"Samsung Galaxy A5"</span>.</span>
'''
soup = BeautifulSoup(html, 'lxml')
get_span = soup.find('span' , attrs={'class' : 't-small summary-count'})

for a in get_span.select('span'):
    print a.previousSibling

```