Home > Net >  I need to do two columns web scraption with python
I need to do two columns web scraption with python

Time:11-02

<div >
<div >
<div >
<div >
<div >
<a href="united-states_florida/company/met-west-commercial-lender/tom-mchugh-975">
              Tom Mchugh
            </a>
</div>
</div>
<div >
<div >
            Company:
            <span>
<a href="united-states_florida/company/met-west-commercial-lender">
                Met West Commercial Lender
                  </a>
</span>
</div>
</div>
</div>

My result showing like this

enter image description here

I want to look like following table:

Column A Column B
Tom Mchugh Met West Commercial Lender

CodePudding user response:

There might be different approaches. Here is an elegant one.

y = df.Name.values
df = pd.DataFrame({'A' : y[::2], 'B' : y[1::2]})
  • Related