Skip to content
Advertisement

Remove certain words from URL

I scraped tweet statuses, from which I’m removing certain words; however, it doesn’t work effectively as it only removes the first string in “stopwords”.

Code:

JavaScript

Output:

JavaScript

I tried different codes after researching, but to no avail. :/

Advertisement

Answer

You just need to de-indent the last line there:

JavaScript

In its original position, it would append the link with /people removed but before removing /photo/1. Then it would append again with /photo/1 removed.

You could alternatively apply this suggestion here and use a compiled regular expression:

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement