Question: Hello I'm starting now in programming and I'm having some problems with Scraping, I'm trying to get all the links in a category with several names, but I'm not getting isolate the cells because there are many with the same name, could someone help me? I will put the picture of my code and the url I want to get.

`

```html
url = 'http://books.toscrape.com/index.html'
reqs = requests.get(url)
if reqs.ok:
    soup = BeautifulSoup(reqs.text, 'html.parser')
    ul = soup.find('ul', {'class': 'nav nav-list'})
    for cells in ul:
        a = cells.find('a')
        link = a['href']
        #print(link)
        [print(str(lis) + '\n\n') for lis in link]
```

=== LINK IMAGE ===

I need to retrieve all urls in (li)

[![enter image description here](https://i.stack.imgur.com/mgSG4.png)](https://i.stack.imgur.com/mgSG4.png)

Answer: 
Okay so I will answer my post because with the suggested TYPED way of doing it was causing problems with the values not being set inside the httpClient, E.G BaseAddress was always null.

In the startup I was trying to go with typed httpclient e.g

```cs
services.AddHttpClient<IReService, ReService>(c => ...

```

But instead of doing that, I choose the to go with the Named client. Which means that in the startup we need to register the httpclient like this

```cs
services.AddHttpClient("recipeService", c => {
....

```

And then in the service itself I used HttpClientFactory like below.

```cs
 private readonly IHttpClientFactory _httpClientFactory;

        public RecipeService(IHttpClientFactory httpClientFactory)
        {
            _httpClientFactory = httpClientFactory;
        }

        public async Task<List<Core.Dtos.Recipes>> GetRecipeBasedOnIngredientsAsync(string recipeEndpoint)
        {
            var client = _httpClientFactory.CreateClient("recipeService");

            using (var response = await client.GetAsync(client.BaseAddress + recipeEndpoint))
            {
                response.EnsureSuccessStatusCode();

                var responseRecipies = await response.Content.ReadAsStringAsync();
                var recipeObj = ConvertResponseToObjectList<Core.Dtos.Recipes>(responseRecipies);

                return recipeObj ?? null;
            }
        }

```
@jack wrote a comment and several guys supported him that this is the right decision, but it is the wrong decision.

AddHttpClient creates a TService service as a Transient service, to which it passes an HttpClient created only for it

Calling first AddTransient, and then AddHttpClient<>, you add 2 implementations of one dependency and only the last added one will be returned

```cs
// Create first dependency
services.AddTransient<HttpService>();

// Create second and last dependency
services.AddHttpClient<HttpService>(client =>
{
    client.BaseAddress = new Uri(baseAdress);
});

```