擅长:python、mysql、java
<p>像这样的</p>
<pre><code>actuallink = 'http://www.exxonmobilperspectives.com'
endPoint = len(actuallink.split('/')) - 1
if endPoint > 0:
slashcounter = 0
indexslash = 0
while slashcounter < endPoint:
if(actuallink[indexslash] == '/'):
slashcounter = slashcounter + 1
indexslash = indexslash + 1
PLink = actuallink[:indexslash]
</code></pre>