# Add a \[PreIndexUrl\] function

**URL:** https://community.mp3tag.de/t/add-a-preindexurl-function/19153
**Category:** Web Sources Discussion
**Created:** [July 16, 2017, 8:21pm UTC](https://community.mp3tag.de/t/add-a-preindexurl-function/19153 "2017-07-16T20:21:18Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![stevehero](https://community.mp3tag.de/user_avatar/community.mp3tag.de/stevehero/32/337_2.png) [@stevehero](https://community.mp3tag.de/u/stevehero)
#### Post date: [July 16, 2017, 8:21pm UTC](https://community.mp3tag.de/t/add-a-preindexurl-function/19153/1 "2017-07-16T20:21:18Z")

</div>

Hi Florian,

I was hoping to see if a new web source fn could be added.

I want to parse this webpage [https://www.traxsource.com/search/artists?term=solomun](https://www.traxsource.com/search/artists?term=solomun) and get the first artist from that search result (mainly to get the artist number and use that info) therefore creating info for the [IndexUrl]=

So the code could look something like this:

This sets up the [PreIndexUrl] =

```
[PreIndexUrl]=https://www.traxsource.com/search/artists?term=%s

```

From that URL you can parse and create the new URL to be used for [IndexUrl]=

```
say "https://www.traxsource.com/artist/"
findline "<a href=\"/artist/"
findinline "<a href=\"/artist/"
sayuntil "/"
say "?cn=titles&ipp=100&ob=r_date&so=desc"

```

The above would create the URL:

```
https://www.traxsource.com/artist/6185/?cn=titles&ipp=100&ob=r_date&so=desc

```

Then use that parsed info [PreIndexUrl] = if applicable:

```
[IndexUrl] = PreIndexUrl

```

The reason for this is with the Traxsource website it's impossible to search releases based on the artist.

The code snippet/section altogether

```
[PreIndexUrl]=https://www.traxsource.com/search/artists?term=%s
say "https://www.traxsource.com/artist/"
findline "<a href=\"/artist/"
findinline "<a href=\"/artist/"
sayuntil "/"
say "?cn=titles&ipp=100&ob=r_date&so=desc"
[IndexUrl] = PreIndexUrl
```
