score:2
Accepted answer
var query = document.documentnode.descendants("a")
.where(a => a.attributes["href"].value.contains("m_name=")
.select(b => new {name=extractname(b.attributes["href"].value),
link=b.descendants("div").first()
.descendants("img").first().attributes["src"].value}).tolist();
score:1
list<string> products = document.documentnode.descendants("a")
.where(a => a.attributes["href"] != null
&&a.attributes["href"].value.contains("m_name=")).select(l =>
l.attributes["href"].substring(l.attributes["href"].indexof("m_name=") + 7)).tolist();
Source: stackoverflow.com
Related Query
- Creating a linq query where 2 values are extracted
- developing LINQ query where column values can be hard coded but row headings are dynamic
- Check if multiple values (stored in a dedicated collection) are in a LINQ collection, in query
- Creating dynamic Linq query based on property values
- How can I check for null values in this linq query where clause
- Linq query where First() appears to return null when results are not found
- How can I keep the the logic to translate a ViewModel's values to a Where clause to apply to a linq query out of My Controller?
- linq query where some from values might be missing
- Linq query doesn't return correct result if values are in different tables
- Linq - Get all keys from dictionary where all values in the value list are equal to criteria
- Unable to pass multiple values in the where clause of a LINQ query
- LINQ Query to compare two values of an object to a list, where both objects must match
- Query a list where no values are returned
- Using a Linq query to select objects where any value of a property matches values from a list
- LINQ query to conditionally filter on a where clause and select the values from another table
- LINQ query joining two tables together to return values that are false
- LINQ query to find items where multiple substrings are searched on one column
- Need a linq query where inclusion indicates property matches all values in secondary list
- How to get flattened list from dictionary key query where values are lists?
- linq query where column contains null values
- LINQ to XML Query to find all child values where parent element name like X C#
- Linq query to remove the first entry with value > 0 in dictionary, when all subsequent values are zero
- Handling null values for C# linq where query
- How to use Linq SQL to perform INNER JOINs where values are equal or one is null
- LINQ query to return distinct field values from list of objects
- LINQ query to find if items in a list are contained in another list
- Is a linq query to ConcurrentDictionary Values threadsafe?
- Iterate through properties and values of an object returned via a linq query on a domain model
- How to Select Min and Max date values in Linq Query
- How to use index/position with Where in LINQ query language?
More Query from same tag
- Linq statement returns null
- Entity Framework Duplicate type name within an assembly (6.1.0)
- Using LINQ to count values in a multiple join
- Linq code refactoring
- How can I create multiple XML files in C# when a stored procedure that is called returns a large number of rows?
- How to use LINQ for multiple filters inside a loop?
- Using LINQ to extract Atrributes from XML
- Complicated LINQ-query, joins, group and sum
- comparing multiple items in the same list
- Linq Select Many from nested list
- Object field Contains arrayElements
- Property not loading straightaway EF6
- Use LINQ to filter SftpFile based on separate given extension array
- Set key inside order by clause in linq dynamically
- LINQ to SQL Join and If Condition
- How to group and merge list of data using LINQ?
- Group List<T> by Column and a count on multiple columns
- EntityFramework : Mapping existing one-to-many relationship to Model
- Linq to replace dataTable values
- group list by property and where it appears more than once
- Why is this LINQ Where clause not returning results?
- how to retrieve rows from database selected from dropdown list in mvc 4
- Many-to-Many Select second order
- How to properly union different IQueryables and then serialize them in JSON
- Can LINQ be used to find gaps in a sorted list?
- LINQ to return null if an array is empty
- How to Compare strings in Linq Query
- Linq to check before it creates select
- How do I get the query text of the IQueryable<T> instance on which this operator is called?
- How to return List instead of an object using Lambda and EF