Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:AGI Edgerunners LLM Agents Papers parse by crawl

From Leeroopedia
Knowledge Sources
Domains Web_Scraping, Data_Extraction
Last Updated 2026-10-10 14:30 GMT

Overview

Concrete tool for extracting paper metadata from arXiv abstract pages via HTML meta-tag scraping, provided by the LLM-Agents-Papers repository.

Description

The parse_by_crawl function fetches an arXiv abstract page via HTTP, then uses regex patterns to extract structured metadata from HTML <meta> tags. It parses the citation_title, citation_author, citation_date, citation_pdf_url, and citation_abstract meta tags. Author names are reformatted from "Last, First" to "First Last" format. The function supports an optional proxy configuration via module-level variables. On HTTP failure or non-200 status, it returns an empty dict.

Usage

Call this function when you need to extract structured paper metadata from an arXiv abstract page URL:

  • Crawling new papers during the collection pipeline (parse_paper calls this for each URL)
  • Extracting title, authors, date, PDF link, and abstract from any https://arxiv.org/abs/... URL
  • Populating a paper metadata dict for subsequent category labeling and persistence

Code Reference

Source Location

Signature

PROXY = None  # Optional proxy dict, e.g. {"https": "127.0.0.1:4780", "http": "127.0.0.1:4780"}
HEADERS = {}  # Optional HTTP headers

def parse_by_crawl(url: str) -> dict:
    """
    Crawl an arXiv abstract page and extract metadata via regex on HTML meta tags.

    Args:
        url: arXiv abstract page URL (e.g. 'https://arxiv.org/abs/2310.01444v2')

    Returns:
        dict with keys: title, authors, date, pdf, abstract, code (''),
        category ([]); or {} on failure.
    """

Import

from script_v5_step1 import parse_by_crawl

I/O Contract

Inputs

Name Type Required Description
url str Yes arXiv abstract page URL (must start with https://arxiv.org/abs/)
PROXY dict / None No Module-level proxy config; None for direct connection
HEADERS dict No Module-level HTTP headers (currently empty)

Outputs

Name Type Description
return dict On success: {title, authors, date, pdf, abstract, code:, category:[]}. On failure: {}.
title str Paper title from citation_title meta tag
authors list[str] Author names, reformatted to "First Last"
date str Publication date in YYYY/MM/DD format
pdf str PDF download URL from citation_pdf_url meta tag
abstract str Paper abstract from citation_abstract meta tag

Usage Examples

Basic arXiv Metadata Extraction

from script_v5_step1 import parse_by_crawl

# Crawl a single arXiv paper page
url = "https://arxiv.org/abs/2310.01444v2"
parsed = parse_by_crawl(url)

if parsed:
    print(f"Title:    {parsed['title']}")
    print(f"Authors:  {', '.join(parsed['authors'])}")
    print(f"Date:     {parsed['date']}")
    print(f"PDF:      {parsed['pdf']}")
    print(f"Abstract: {parsed['abstract'][:200]}...")
else:
    print(f"Failed to crawl {url}")

Batch Crawling from Seed List

from script_v5_step1 import parse_by_crawl, read_json

papers = read_json("papers_v5.json")
results = []

for entry in papers:
    url = entry.get("url", "")
    if url.startswith("https://arxiv.org/abs/"):
        parsed = parse_by_crawl(url)
        if parsed:
            # Optionally attach code link from seed
            if entry.get("code"):
                parsed["code"] = entry["code"]
            parsed["url"] = url
            results.append(parsed)
            print(f"OK: {parsed['title']}")
        else:
            print(f"FAIL: {url}")

print(f"Crawled {len(results)}/{len(papers)} papers")

With Proxy Configuration

import script_v5_step1

# Set proxy for regions requiring VPN
script_v5_step1.PROXY = {"https": "127.0.0.1:4780", "http": "127.0.0.1:4780"}

parsed = script_v5_step1.parse_by_crawl("https://arxiv.org/abs/2310.01444v2")

Related Pages

Implements Principle

Requires Environment

Uses Heuristic

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment